API changes at 2009-01-16

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
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

API changes at 2009-01-16

Post by TrueBrain »

Today, we pushed through some name consistancy changes ... this will break most (if not all) AIs again. We are sorry for this, but at this stage this simply is required. As far as I can tell, this should be the last API change for at least this month. From now on we will collect API changes a bit more, and push them through in one day. Nevertheless, expect API changes up till the point we start our release cycle.

Todays changes, consts renaming:

Code: Select all

   INVALID_TOWN_RATING        -> TOWN_RATING_INVALID
   INVALID_TRANSPORT          -> TRANSPORT_INVALID
   INVALID_ORDER              -> ORDER_INVALID
   INVALID_GROUP              -> GROUP_INVALID
   ALL/DEFAULT_GROUP          -> GROUP_ALL/DEFAULT
   VEHICLE_RAIL/ROAD/..       -> VT_RAIL/ROAD/..
   MY_COMPANY                 -> COMPANY_SELF
   FIRST/LAST/INVALID_COMPANY -> COMPANY_FIRST/LAST/INVALID
Any questions, feel free to ask!
The only thing necessary for the triumph of evil is for good men to do nothing.
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Re: API changes at 2009-01-16

Post by Moriarty »

This may already be the case - but is there an NOAI API version? As in, each time you add a bunch of features (as you're planning on doing in clumps in the future), the version number could be incremented, like with save-game versions.
Then the AI's could come with version numbers to reflect what API they're currently workable with.
Just a thought.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: API changes at 2009-01-16

Post by Yexo »

There is no API version stored currently, and imo it's not necessary. Last week there were several API changes, but if all is well API changes should almost never happen anymore. Also, when you upload an AI to bananas you can specify a minimum and maximum version of OpenTTD that your AI works with.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests