Difference between revisions of "ReadingPatchVariables"

From GRFSpecs
Jump to navigationJump to search
m (Bot: Automated text replacement (- 2.0 + TTDPatch 2.0))
(→‎variable: 0x17: Map seed)
 
(6 intermediate revisions by 2 users not shown)
Line 35: Line 35:
   
 
{|
 
{|
!variable!!Switch!!Value
+
!variable!!Switch!!Version!!Value
 
 
|-
 
|-
|00||miscmods/-Yo||Bit switch
+
|00||miscmods/-Yo||{{ottdp|no|2.5}}||Bit switch
 
 
|-
 
|-
|01||experimentalfeatures/-XF||Bit switch
+
|01||experimentalfeatures/-XF||{{ottdp|no|2.5}}||Bit switch
 
 
|-
 
|-
|02||morevehicles/-x||Vehicle array multiplier
+
|02||morevehicles/-x||{{ottdp|no|2.5}}||Vehicle array multiplier
 
 
|-
 
|-
|03||mountains&curves;/-mc||Two bytes with four sets of two bits
+
|03||mountains and curves/-mc||{{ottdp|no|2.5}}||Two bytes with four sets of two bits
 
 
|-
 
|-
|04||planecrashcontrol/-Xc||Bit switch
+
|04||planecrashcontrol/-Xc||{{ottdp|no|2.5}}||Bit switch
 
 
|-
 
|-
|05||autorenew/-Xa||Signed value
+
|05||autorenew/-Xa||{{ottdp|no|2.5}}||Signed value
 
 
|-
 
|-
|06||multihead/-M||Speed increase, in percent
+
|06||multihead/-M||{{ottdp|no|2.5}}||Speed increase, in percent
 
 
|-
 
|-
|07||disasters/-XD||Bit switch
+
|07||disasters/-XD||{{ottdp|no|2.5}}||Bit switch
 
 
|-
 
|-
|08||unifiedmaglev/-XM||Unified maglev mode
+
|08||unifiedmaglev/-XM||{{ottdp|no|2.5}}||Unified maglev mode
 
 
|-
 
|-
|09||bridgespeedlimits/-XX||Speed fraction, in percent
+
|09||bridgespeedlimits/-XX||{{ottdp|no|2.5}}||Speed fraction, in percent
 
 
|-
 
|-
|0A||---||TTD Language, see the "new scheme" for [[Action4#language id|action 4]]
+
|0A||---||{{ottdp|no|2.5}}||TTD Language, see the "new scheme" for [[Action4#language id|action 4]]
 
 
|-
 
|-
|0B||startyear/-XY||Year-1920
+
|0B||startyear/-XY||{{ottdp|0.6|2.5}}||Year-1920
 
 
|-
 
|-
|0C||morebuildoptions/-YB||Bit switch
+
|0C||morebuildoptions/-YB||{{ottdp|no|2.5}}||Bit switch
 
 
|-
 
|-
|0D||moresteam/-YM||value=LF (two hex digits), L=length, F=frequency
+
|0D||moresteam/-YM||{{ottdp|no|2.5}}||value=LF (two hex digits), L=length, F=frequency
 
 
|-
 
|-
|0E||freighttrains/-Yf||weight factor
+
|0E||freighttrains/-Yf||{{ottdp|0.6|2.5}}||weight factor
 
 
|-
 
|-
|0F||wagonspeedlimits/-YL||Speed increase for empty wagons
+
|0F||wagonspeedlimits/-YL||{{ottdp|0.6|2.5}}||Speed increase for empty wagons
 
 
|-
 
|-
|10||planespeed/-YP||speed factor
+
|10||planespeed/-YP||{{ottdp|0.6|2.5}}||speed factor
 
 
|-
 
|-
|11||dual company colors||2CC colormap base sprite (since r1404)
+
|11||dual company colors||{{ottdp|0.6|2.5|ttdprev=r1404}}||2CC colormap base sprite
 
 
|-
 
|-
|12||miscmods2/-Zm||Bit switch (since r1738)
+
|12||miscmods2/-Zm||{{ottdp|no|2.6|ttdprev=r1738}}||Bit switch
 
 
|-
 
|-
|13||map size information||Format = -MABXYSS (since r11961 and r1817)
+
|13||map size information||{{ottdp|0.6|2.6|ottdrev=r11961|ttdprev=r1817}}||Format = -MABXYSS
  +
{| |-
 
  +
| M || the type of map
 
* bit 0 set: squared map. Clear : rectangular map
 
* bit 1 set: Y is the bigger edge(bit 0 is clear).Clear : X is the bigger edge.
 
|-
 
|-
||| || M : the type of map
+
|A || minimum edge(log2) of the map
 
 
|-
 
|-
 
|B || maximum edge(log2) of the map
||| ||bit 0 set : squared map. Clear : rectangular map
 
 
 
|-
 
|-
 
|XY || edges(log2) of each side of the map.
||| ||bit 1 set : Y is the bigger edge(bit 0 is clear).Clear : X is the bigger edge.
 
 
 
|-
 
|-
||| ||A : minimum edge(log2) of the map
+
|SS || combination of both X and Y, thus giving the size(log2) of the map
 
 
|-
 
|-
  +
|}
||| ||B : maximum edge(log2) of the map
 
 
All map sizes will be substracted by 6, as to keep the size 64 the smallest one, thus zero based
 
 
|-
 
|-
  +
|14||maximum height level||{{ottdp|1.2|no|ottdrev=r23158}}||Maximal possible height level of a tile. {{ottdp|1.5|no|ottdrev=r27010}}Any value between 1 and 255. In earlier versions fixed at 15.
||| ||XY : edges(log2) of each side of the map.
 
 
 
|-
 
|-
  +
|15||extra foundations||{{ottdp|1.4|no|ottdrev=r25230}}||Extra foundation sprites as set via [[Action5|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.
||| ||SS : combination of both X and Y, thus giving the size(log2) of the map
 
 
 
|-
 
|-
  +
|16||coast sprites||{{ottdp|1.4|no|ottdrev=r25230}}||All coast sprites in the order of the 16 sprites version of [[Action5#In_NewGRFs|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.
||| ||All map sizes will be substracted by 6, as to keep the size 64 the smallest one, thus zero based
 
  +
|-
  +
|17||map seed||{{ottdp|13.0|no|ottdrev=g08a5478a9}}||Map generation seed.
 
|}
 
|}
   

Latest revision as of 13:20, 13 March 2022

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 Not supported by OpenTTD Supported by TTDPatch 2.52.5 Bit switch
01 experimentalfeatures/-XF Not supported by OpenTTD Supported by TTDPatch 2.52.5 Bit switch
02 morevehicles/-x Not supported by OpenTTD Supported by TTDPatch 2.52.5 Vehicle array multiplier
03 mountains and curves/-mc Not supported by OpenTTD Supported by TTDPatch 2.52.5 Two bytes with four sets of two bits
04 planecrashcontrol/-Xc Not supported by OpenTTD Supported by TTDPatch 2.52.5 Bit switch
05 autorenew/-Xa Not supported by OpenTTD Supported by TTDPatch 2.52.5 Signed value
06 multihead/-M Not supported by OpenTTD Supported by TTDPatch 2.52.5 Speed increase, in percent
07 disasters/-XD Not supported by OpenTTD Supported by TTDPatch 2.52.5 Bit switch
08 unifiedmaglev/-XM Not supported by OpenTTD Supported by TTDPatch 2.52.5 Unified maglev mode
09 bridgespeedlimits/-XX Not supported by OpenTTD Supported by TTDPatch 2.52.5 Speed fraction, in percent
0A --- Not supported by OpenTTD Supported by TTDPatch 2.52.5 TTD Language, see the "new scheme" for action 4
0B startyear/-XY Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 Year-1920
0C morebuildoptions/-YB Not supported by OpenTTD Supported by TTDPatch 2.52.5 Bit switch
0D moresteam/-YM Not supported by OpenTTD Supported by TTDPatch 2.52.5 value=LF (two hex digits), L=length, F=frequency
0E freighttrains/-Yf Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 weight factor
0F wagonspeedlimits/-YL Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 Speed increase for empty wagons
10 planespeed/-YP Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 speed factor
11 dual company colors Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (r1404)2.5 2CC colormap base sprite
12 miscmods2/-Zm Not supported by OpenTTD Supported by TTDPatch 2.6 (r1738)2.6 Bit switch
13 map size information Supported by OpenTTD 0.6 (r11961)0.6 Supported by TTDPatch 2.6 (r1817)2.6 Format = -MABXYSS
M the type of map
  • bit 0 set: squared map. Clear : rectangular map
  • bit 1 set: Y is the bigger edge(bit 0 is clear).Clear : X is the bigger edge.
A minimum edge(log2) of the map
B maximum edge(log2) of the map
XY edges(log2) of each side of the map.
SS combination of both X and Y, thus giving the size(log2) of the map

All map sizes will be substracted by 6, as to keep the size 64 the smallest one, thus zero based

14 maximum height level Supported by OpenTTD 1.2 (r23158)1.2 Not supported by TTDPatch Maximal possible height level of a tile. Supported by OpenTTD 1.5 (r27010)1.5 Not supported by TTDPatchAny value between 1 and 255. In earlier versions fixed at 15.
15 extra foundations Supported by OpenTTD 1.4 (r25230)1.4 Not supported by TTDPatch 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 Supported by OpenTTD 1.4 (r25230)1.4 Not supported by TTDPatch 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 Supported by OpenTTD 13.0 (g08a5478a9)13.0 Not supported by TTDPatch 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.