ReadingPatchVariables
From GRFSpecs
Jump to navigationJump to searchThe printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Introduction
Since TTDPatch 2.0.1 alpha 48, it has been possible to use action D to read various special Patch variables. These are usually switch values, but there are also a few other useful values.
Syntax
<Sprite-number> * <Length> 0D <target> <operation> <variable> FE FF FF 00 00
Element | Size | Description |
---|---|---|
0D | B | Defines action 0D |
<target> | B | Target parameter |
<operation> | B | As for ActionD, but only assignment is valid. |
<variable> | B | Patch variable number to read. See below. |
FE | B | Defines a special variable access |
FF FF 00 00 | D | Indicates that a patch variable is being read |
variable
The following patch variables are defined:
variable | Switch | Version | Value | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | miscmods/-Yo | 2.5 | Bit switch | ||||||||||
01 | experimentalfeatures/-XF | 2.5 | Bit switch | ||||||||||
02 | morevehicles/-x | 2.5 | Vehicle array multiplier | ||||||||||
03 | mountains and curves/-mc | 2.5 | Two bytes with four sets of two bits | ||||||||||
04 | planecrashcontrol/-Xc | 2.5 | Bit switch | ||||||||||
05 | autorenew/-Xa | 2.5 | Signed value | ||||||||||
06 | multihead/-M | 2.5 | Speed increase, in percent | ||||||||||
07 | disasters/-XD | 2.5 | Bit switch | ||||||||||
08 | unifiedmaglev/-XM | 2.5 | Unified maglev mode | ||||||||||
09 | bridgespeedlimits/-XX | 2.5 | Speed fraction, in percent | ||||||||||
0A | --- | 2.5 | TTD Language, see the "new scheme" for action 4 | ||||||||||
0B | startyear/-XY | 0.6 2.5 | Year-1920 | ||||||||||
0C | morebuildoptions/-YB | 2.5 | Bit switch | ||||||||||
0D | moresteam/-YM | 2.5 | value=LF (two hex digits), L=length, F=frequency | ||||||||||
0E | freighttrains/-Yf | 0.6 2.5 | weight factor | ||||||||||
0F | wagonspeedlimits/-YL | 0.6 2.5 | Speed increase for empty wagons | ||||||||||
10 | planespeed/-YP | 0.6 2.5 | speed factor | ||||||||||
11 | dual company colors | 0.6 2.5 | 2CC colormap base sprite | ||||||||||
12 | miscmods2/-Zm | 2.6 | Bit switch | ||||||||||
13 | map size information | 0.6 2.6 | Format = -MABXYSS
All map sizes will be substracted by 6, as to keep the size 64 the smallest one, thus zero based | ||||||||||
14 | maximum height level | 1.2 | Maximal possible height level of a tile. 1.5 Any value between 1 and 255. In earlier versions fixed at 15. | ||||||||||
15 | extra foundations | 1.4 | Extra foundation sprites as set via Action 5 type 06. This sprite block does only contain the extra foundations from Action 5, it does not contain the default foundations of Action A sprites 990 to 1003. | ||||||||||
16 | coast sprites | 1.4 | All coast sprites in the order of the 16 sprites version of Action 5 type 0D. Note that, it does not matter in which way the sprites were originally defined (whether via Action 5 with 10 or 16 sprites, or via Action A), the sprite block returned by this variable has always all sprites in the same order. | ||||||||||
17 | map seed | 13.0 | Map generation seed. |
If experimentalfeatures, miscmods, or miscmods2 are off, the corresponding value will be zero. For all other switches, the value is unspecified if the switch is off, so action 7 variable 85 should be checked first.