NoGo: Change in OpenTTD regarding bankruptcy and takeover

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
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

NoGo: Change in OpenTTD regarding bankruptcy and takeover

Post by Zuu »

As of r24986 OpenTTD will now clean up company related entities when a company is closed down or taken over. This change applies both to company specific goals and cargo monitors. So players will no longer end up seeing goals from some old bankrupt company because the GS was not quick enough to remove those.

Due to the nature of this change, note that scripts that are using API 1.2 in 1.3 will still show the new behaviour. If you want to write a GS that is compatible with both 1.2 and 1.3 behaviour, assume the 1.2 behaviour (eg. try to clean up yourself) and ignore that removing goals will fail due to invalid goal ID. Another way is to use GSController::GetVersion to detect the OpenTTD version. Or just drop support for 1.2 when 1.3 is released.


My judgment is that this change will not break many if any scripts, but will help GS authors who write scripts that do not break apart its tasks into small chunks that are interleaved with calls to code that polls the event stack to quickly process new events.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 13 guests