Recent api additions

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
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Recent api additions

Post by Yexo »

There are two new optional functions in info.nut:
GetUrl() can return a string that points to your own website or a forum thread for your AI. It'll be displayed in the AI debug panel when your AI crashes. It's also shown in the AI selection window.
UseAsRandomAI() can return true (default) or false. When it returns false that AI will never be chosen randomly, the user will have to select that AI explicitly. Main use would be helper AIs that don't really compete, like TownCars.

AIOrder.AIOF_STOP_IN_DEPOT has been added as an order flag to allow AIs to give stop in depot orders.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Recent api additions

Post by Morloth »

Yexo wrote:AIOrder.AIOF_STOP_IN_DEPOT has been added as an order flag to allow AIs to give stop in depot orders.
Yata! :mrgreen:

Thanks for the quick update Yexo
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Recent api additions

Post by fanioz »

Sound a good improvement, AI's can do like human(giving to depot order) :D wich nigthlies minimum required?
edit:: I guess R 16107 :)
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Maninthebox
Engineer
Engineer
Posts: 113
Joined: 08 Aug 2008 11:35
Contact:

Re: Recent api additions

Post by Maninthebox »

Yexo wrote: UseAsRandomAI() can return true (default) or false. When it returns false that AI will never be chosen randomly, the user will have to select that AI explicitly. Main use would be helper AIs that don't really compete, like TownCars.
I guess this is also a nice one for Rondje... if you'd actually like to build cargo routes with trucks you don't want rondje to start :mrgreen:
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests