How to

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
Hamilton2007
Transport Coordinator
Transport Coordinator
Posts: 289
Joined: 16 Nov 2008 10:57
Location: Belgium

How to

Post by Hamilton2007 »

How do you insert new AI in the game ?

Where do you copy the tar file and what do you need to write in the openttd.cfg?
Attachments
AI.PNG
AI.PNG (7.26 KiB) Viewed 4231 times
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: How to

Post by Yexo »

1) Download a NoAI binary.
2) Place the tar file in bin/ai/ (or just ai/)
3) Start a new game.
4) open the console (key left of '1' on your keyboard)
5) type "start_ai AINAME" (without quotes), were AINAME is the name of an AI you downloaded (or wrightai since that one is included with noai).

Instead of steps 4) and 5) you can also set the number of AI players in the difficulty window to some value > 0 and the game will automatically start a random AI.
Lego3
Engineer
Engineer
Posts: 5
Joined: 12 Jan 2009 19:46

Re: How to

Post by Lego3 »

I have a problem related to this: The game says "command or variable not found" if I try "start_ai" and no AI players ever start no matter what settings I have. What do I do?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: How to

Post by TrueBrain »

Lego3 wrote:I have a problem related to this: The game says "command or variable not found" if I try "start_ai" and no AI players ever start no matter what settings I have. What do I do?
Download the latest nightly ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
Lego3
Engineer
Engineer
Posts: 5
Joined: 12 Jan 2009 19:46

Re: How to

Post by Lego3 »

TrueBrain wrote:
Lego3 wrote:I have a problem related to this: The game says "command or variable not found" if I try "start_ai" and no AI players ever start no matter what settings I have. What do I do?
Download the latest nightly ;)
I did that 15 minutes before I posted this. I had problems with no (normal) AI starting regardless of settings in 0.6.3 before I downloaded the nightly too. Is a shared configuration file corrupt somewhere maybe? I tried removing the OpenTTD folder that contains saved games and the openttd.cfg file - resetting settings. It did not help.
Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: How to

Post by Conditional Zenith »

By the latest nightly, he perhaps meant the nightly that is about to come out.
Lego3
Engineer
Engineer
Posts: 5
Joined: 12 Jan 2009 19:46

Re: How to

Post by Lego3 »

Conditional Zenith wrote:By the latest nightly, he perhaps meant the nightly that is about to come out.
I see. :) Now it works.
User avatar
RSpeed tycoonfreak
Transport Coordinator
Transport Coordinator
Posts: 349
Joined: 02 Feb 2006 13:17
Location: Azewijn The netherlands
Contact:

Re: How to

Post by RSpeed tycoonfreak »

Hello, I just downloaded the latest nightly (R15141) but how do I install the noAI beacause i don't have an map called AI
Visit The Fake Airport Website
Image
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: How to

Post by Conditional Zenith »

NoAI is part of the trunk, you don't need to install it. I don't know why you are looking for a map, you either download AIs from the content server, or you create a directory called ai that is next to the data directory, and put AIs in there.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: How to

Post by Zuu »

Conditional Zenith wrote:I don't know why you are looking for a map
Probably he got hit by a false friend. I don't know Dutch, but in Swedish which has much common with other European languages, "mapp" has the same meaning as the English word "Directory" when one is speaking about computers.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: How to

Post by Conditional Zenith »

ahh. That does make sense. Anyway, in the context of the above post, using map instead of directory or folder is really confusing.
User avatar
RSpeed tycoonfreak
Transport Coordinator
Transport Coordinator
Posts: 349
Joined: 02 Feb 2006 13:17
Location: Azewijn The netherlands
Contact:

Re: How to

Post by RSpeed tycoonfreak »

Zuu wrote:
Conditional Zenith wrote:I don't know why you are looking for a map
Probably he got hit by a false friend. I don't know Dutch, but in Swedish which has much common with other European languages, "mapp" has the same meaning as the English word "Directory" when one is speaking about computers.
Yeah exactly sorry for my bad english, i meant Directory ofcourse :oops:

EDIT:
I got it working now (sort of)
Because openttd is recognising the downloaded AI (admiralai-v19)
But it didn't build anything. (see screenshot)
I made a directory called ai and put the downloaded file in there but nothing happens.
Attachments
Lenborough Transport, 1 Feb 1940.PNG
Lenborough Transport, 1 Feb 1940.PNG (189.22 KiB) Viewed 542 times
Visit The Fake Airport Website
Image
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: How to

Post by glx »

Use the "online content download" feature to get the libraries.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests