I've discovered that there's a limit of 255 goal objects in total using the GSGoal interface. (Calling GSGoal.New() 256 times yields a problem) It took me about an hour of digging through openTTD's code base to actually find this, so let's state the following for the record:
This limit is mentioned nowhere in the API. It should probably be mentioned as it can quite lead to problems. There is also no communication to the script whatsoever as to the status of this limit, so the gamescript writer is forced to either book-keep himself, which is double-counting something that needn't be, or forced to be left guessing. Also, the behaviour when creating the 256th-object is unknown to me, and also undocumented. Furthermore, if a gamescript that uses goals is hoped to be included in another gamescript, that second gamescript has to incorporate the former's counting into its own, and this will quickly get messy, especially with libraries around using Goal objects.
And, last but not least, it maybe a bit low of a limit. Sure, in a game with one company most scripts will not reach this number. But with, say, 16 companies, even keeping a simple score list, or a goal for each (rival) company that exists, is all but impossible due to 16*16 = 256 > 255.
If I wanted to have a goal for each cargo type, that's 32 * 16 = 512, also more.
GSGoal Hidden limit
Moderator: OpenTTD Developers
Re: GSGoal Hidden limit
Reporting it to http://bugs.openttd.org/ may be a good idea.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: GSGoal Hidden limit
In tomorrows nightly you will have to work harder to reach the limit.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Who is online
Users browsing this forum: No registered users and 5 guests