GS Documentation

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
idioty
Engineer
Engineer
Posts: 59
Joined: 21 Jun 2010 11:54

GS Documentation

Post by idioty »

I found the following in the documentation:
INVALID_EXPENSES
Why this name?
Why do not more: EXPENSES_INVALID, like others INVALID type?

And in GSCompany:
static uint32 GetAutoRenewMoney (CompanyID company)
Why static uint32? Why do not more: static Money, like others Money methodes?
Sorry my bad english, I don't speak english!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: GS Documentation

Post by Zuu »

idioty wrote:I found the following in the documentation:
INVALID_EXPENSES
Why this name?
Why do not more: EXPENSES_INVALID, like others INVALID type?
Because the internal Enum uses the name EXPENSES_INVALID and among all things to think about, I didn't remember to take a look at the other API methods for the possibility that the INVALID constant use a different naming pattern than the internal constants. Sorry about that.

I can 'fix' this and render the few scripts that rely on EXPENSES_INVALID broken for a short while before they get fixed.
idioty wrote:And in GSCompany:
static uint32 GetAutoRenewMoney (CompanyID company)
Why static uint32? Why do not more: static Money, like others Money methodes?
I don't know the reason behind this. It may be historic or the same as above that the internal data type is uint32.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
R2dical
Traffic Manager
Traffic Manager
Posts: 163
Joined: 18 Mar 2013 22:22

Re: GS Documentation

Post by R2dical »

For "static int32 GSTown::GetGrowthRate"

Code: Select all

Returns:
    True if the action succeeded. 
Doesn't this function actually return the days between growth?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: GS Documentation

Post by Zuu »

idioty wrote:I found the following in the documentation:
INVALID_EXPENSES
Fixed in r25788 (changed to EXPENSES_INVALID)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
idioty
Engineer
Engineer
Posts: 59
Joined: 21 Jun 2010 11:54

Re: GS Documentation

Post by idioty »

Zuu wrote:
idioty wrote:I found the following in the documentation:
INVALID_EXPENSES
Fixed in r25788 (changed to EXPENSES_INVALID)
Thx!
Sorry my bad english, I don't speak english!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 18 guests