Need som help on my problem

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
WaterOfHell
Engineer
Engineer
Posts: 41
Joined: 26 Aug 2010 22:58
Location: Cagayan De Oro,Philippines
Contact:

Need som help on my problem

Post by WaterOfHell »

Ok so I already spend 1 month on finding a way how to make the AI's work.First of all I got OpenTTD v18404,and I got the source and library files but the AI's wont appear on the AI menu.Am I missing some files or i just put the files on the wrong folder? :(

Here's my file directory order:

E:/openttd/
ai(folder)
compat_0.7.nut
compat_0.8.nut
content_download(folder)
ai(folder)
.nut files and the .tar AI's
library(folder)
.tar Libraries

Or simple as:

E:/openttd/ai/compat_0.7.nut and compat_0.8.nut
E:/openttd/content_download/ai/main.nut,info.nut etc... And .tar AI's
E:/openttd/content_download/library/.tar Libraries

Little help please :(
Its Not How You Play The Game
Its How The Game Play's You
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: Need som help on my problem

Post by Supercheese »

WaterOfHell wrote:... I got OpenTTD v18404...
That seems really old -- the most recent nightly is r23190, perhaps you'd do better trying that: http://www.openttd.org/en/download-trunk
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Need som help on my problem

Post by Rubidium »

Put your main.nut, info.nut and all other nuts of your AI in a subdirectory of "ai", e.g. ai/MyAI/main.nut. The subdirectory is required so you can have multiple AIs at the same time, and that's the part that you are missing.
WaterOfHell
Engineer
Engineer
Posts: 41
Joined: 26 Aug 2010 22:58
Location: Cagayan De Oro,Philippines
Contact:

Re: Need som help on my problem

Post by WaterOfHell »

but I dont have my own AI im just using AI's from NOAI thread.Should I really make a MyAI folder?

Yeah im using the old version,is there an AI for old versions?
Its Not How You Play The Game
Its How The Game Play's You
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: Need som help on my problem

Post by Brumi »

No you don't need a MyAI folder, Rubidium only assumed that you were developing your own AI :)
It is OK to put the .tar files of AIs into the /ai directory, and the library .tar's into the /ai/library directory.

Most AIs don't support your old version though, so you should either find an AI which is written to work with the 0.7 API (or simply an older version of an AI which doesn't support it), or upgrade your OpenTTD. AFAIK newer OpenTTD versions are fully backward compatibile (except for some NewGRF-related things), so upgrading shouldn't be a problem. If you're unsure about this, simply download a .zip of the new version, so that you can try if it works with your savegames. Just be sure not to overwrite your old openttd.cfg.
Older versions of AIs are available for download somewhere if my memory serves right, but I don't know where, a few minutes of searching weren't enough.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Need som help on my problem

Post by Zuu »

Brumi wrote:Just be sure not to overwrite your old openttd.cfg.

Why not?
Brumi wrote:
Older versions of AIs are available for download somewhere if my memory serves right, but I don't know where, a few minutes of searching weren't enough.
Most if my AIs have old versions laying around at the forums. Mind that you probably need to open main.nut and read at the top to figure out which library versions that it needs unless that is stated in the same forum post.

A better solution is still to upgrade OpenTTD so that you get all bug fixes.in both OpenTTD and the AIs. If you are on windows, you might be interested in my OpenTTD Auto Updater (see my sig) to keep a nightly OpenTTD installation up to date.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: Need som help on my problem

Post by Brumi »

Zuu wrote:Why not?
I tend to make sure that openttd.cfg's of different versions do not mix. So doesn't it confuse the old version if the new version messes with its cfg file?
WaterOfHell
Engineer
Engineer
Posts: 41
Joined: 26 Aug 2010 22:58
Location: Cagayan De Oro,Philippines
Contact:

Re: Need som help on my problem

Post by WaterOfHell »

Thanks :) the AI's appear at the AI menu now.

Last question,how to start them?i set all AI's at start date 1 but they didnt appear in the beggining of the game.
Its Not How You Play The Game
Its How The Game Play's You
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: Need som help on my problem

Post by Brumi »

Simply wait :)
They don't neccessarily start after 1 day, even if you set it so. And you won't get that 'New company launched' notification immediately as the AI starts, because it appears when the AI has built something on the map. It may have started thinking without building immediately.
Anyway, if you really want to start an AI immediately, open the console and type 'start_ai'. The next AI will start immediately.
WaterOfHell
Engineer
Engineer
Posts: 41
Joined: 26 Aug 2010 22:58
Location: Cagayan De Oro,Philippines
Contact:

Re: Need som help on my problem

Post by WaterOfHell »

thanks :) its working now
Its Not How You Play The Game
Its How The Game Play's You
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 10 guests