GSController - how do we check Load()'s version ?

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
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

GSController - how do we check Load()'s version ?

Post by keoz »

I don't know if I'm doing things wrongly or if there is a real problem here.

When using a MainClass::Load(version, tb) function, we should be able to use "version" parameter to decide what to do.

But: I've seen that if the savegame's version isn't the same as the actual used version, the function Load() isn't even called (to avoid loading unconsistent data). If I'm not wrong, this makes pointless the "version" parameter, because it is actually available only when it is the same as the actual GS version.

Or, did I miss something about the way of checking savegame's version ?

Note: yes, maybee should I fill a bugreport, but I'm not sure whether this isn't a PEBCAK problem. :D
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: GSController - how do we check Load()'s version ?

Post by krinn »

http://nogo.openttd.org/api/trunk/class ... bef07589b6
If this function does not exist OpenTTD assumes it can only load savegames of this version.
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: GSController - how do we check Load()'s version ?

Post by keoz »

:D

Thank you.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 25 guests