AI development questions

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
oxyk
Engineer
Engineer
Posts: 29
Joined: 04 May 2012 06:51
Location: ukraine

AI development questions

Post by oxyk »

hi guys,
i have 3 questions about AI scripting. I hope someone can help me with it. i'm pretty new to squirrel and noAI API.

1. how to get rid of 0.7 AI compatibility when i want it to be at least 1.0? is there any specific option for info page?

2. is there any way to generate president face manually? i know how to set gender, name and company name. the only thing i'm missing is how to setup face attributes.

3. when user disable road type for AI, will it disable both road and tram tracks, or only tram? i've got only tram disabled by this option. i wonder if it's my faulty function or it's how it supposed to be with road/tram?

thank you in advance :)
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: AI development questions

Post by Xander »

To set what version of the NoAI API your AI uses, add this line to your info.nut:

Code: Select all

function GetAPIVersion()  { return "1.0"; }
http://wiki.openttd.org/AI:Introduction#Register
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI development questions

Post by Brumi »

2. Have a look at the AICompany class, especially the functions SetName, SetPresidentGender and SetPresidentName. As far as I know changing the face is not possible.

3. Do you mean the case when the user disables road vehicles for AIs in the advanced settings? It will disable both road and tram tracks. The user can disable trams only by not adding a NewGRF that contains trams though. Anyway, you are free to define settings for your AI which enables/disables these individually.
oxyk
Engineer
Engineer
Posts: 29
Joined: 04 May 2012 06:51
Location: ukraine

Re: AI development questions

Post by oxyk »

thank you for your explanation.

i have used wrong enumerator for road type, now function works properly.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests