OpenTTD GameScript API
20240906-master-gd5ff6b4156
|
IDs are used to identify certain objects. They are only unique within the object type, so for example a vehicle may have VehicleID 2009, while a station has StationID 2009 at the same time. Also IDs are assigned arbitrary, you cannot assume them to be consecutive. Also note that some IDs are static and never change, while others are allocated dynamically and might be reused for other objects once they are released. So be careful, which IDs you store for which purpose and whether they stay valid all the time.
type | object | acquired | released | reused |
---|---|---|---|---|
BridgeID | bridge type | introduction (1) | never (1) | no (1) |
CargoID | cargo type | game start (1) | never (1) | no (1) |
EngineID | engine type | introduction, preview (2) | engines retires (2) | no (2) |
GoalID | goal | creation | deletion | yes |
GroupID | vehicle group | creation | deletion | yes |
IndustryID | industry | construction | closure | yes |
IndustryType | industry type | game start (1) | never (1) | no |
ObjectType | NewGRF object type | game start (1) | never (1) | no |
ScriptErrorType | error message | OpenTTD start (3) | OpenTTD exit | no |
SignID | sign | construction | deletion | yes |
StationID | station | construction | expiration of 'grey' station sign after deletion | yes |
StringID | translatable text | OpenTTD start (3) | OpenTTD exit | no |
SubsidyID | subsidy | offer announcement | (offer) expiration | yes |
StoryPageID | story page | creation | deletion | yes |
StoryPageElementID | story page element | creation | deletion | yes |
TileIndex | tile on map | game start | never | no |
TownID | town | game start | never | no |
VehicleID | vehicle | construction, autorenew, autoreplace | destruction, autorenew, autoreplace | yes |