AI TAR archive?

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
jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

AI TAR archive?

Post by jogi »

Hello there

I'm just starting out with writing my own AI. Thanks to the wiki, I was able to get the TestAI running in one of my games. However, it took me a bit of trying, before I figured out how exactly it's done. It only worked, after I put the files in a tar archive (just putting the source-folder into the ai folder did not work). My question is: Is this always necessary, or is there an option to change that, since its not mentioned in the article? (I also read substatial parts of the AI-Developer section of the wiki, without finding anything about it)

If the TAR-file is actually required, should I perhaps write an addition to the wiki-article?

Some Backgroundinfo:
I'm using version 1.2.3 from the ubuntu-repositories, and I want to include the AI from the

Code: Select all

~/.openttd/ai/
folder.

Code: Select all

~/.openttd/content_download/ai/
works the same way (TAR required, even when mentioned in the wiki)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AI TAR archive?

Post by Zuu »

Do you have something like this as the path to info.nut of your AI? (the name of the "test-ai" directory is not critical, but if you don't have a directory there for each AI, I'm unsure if it will work)

Code: Select all

~/.openttd/ai/test-ai/info.nut

Edit: If the comment above doesn't solve your problem, you could try with OpenTTD 1.3 to see if that works better. It is two years newer and if you are affected by a bug, it might have got fixed.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AI TAR archive?

Post by jogi »

Yes, on my latest try, it was:

Code: Select all

~/.openttd/ai/TestAI/Info.nut
If I open a game, and issue the listai-command, I don't see my AI, but if I run

Code: Select all

tar -cf testai.tar TestAI
the AI shows up, independent of the version (1.2.3 or 1.3.0 from your Link)

Basically, I know how to get the AI running, but I'm just curious, should the ai also be recognized, if it is not in the tar archive?
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI TAR archive?

Post by Brumi »

The game should be able to see your AI even if it is untarred.

Could you please post your files here so that we can have a look?
jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AI TAR archive?

Post by jogi »

These are the files, which I put into

Code: Select all

~/.openttd/ai/TestAI/Info.nut
(They're Basically just the TestAI from the wiki with some names changed)
Attachments
Info.nut
(1.37 KiB) Downloaded 111 times
Main.nut
(917 Bytes) Downloaded 121 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AI TAR archive?

Post by Zuu »

I think that info.nut and main.nut should have lower case names.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AI TAR archive?

Post by jogi »

Yep, that's it. Thank you for the advice.

I got the names from this wikipage, where they were capitalized: http://wiki.openttd.org/AI:TestAI

(I changed them already)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests