ReadingPatchVariables

From GRFSpecs

Jump to: navigation, search

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
ElementSizeDescription
0DBDefines action 0D
<target>BTarget parameter
<operation>BAs for ActionD, but only assignment is valid.
<variable>BPatch variable number to read. See below.
FEBDefines a special variable access
FF FF 00 00DIndicates that a patch variable is being read

variable

The following patch variables are defined:

variableSwitchVersionValue
00miscmods/-YoNot supported by OpenTTD Supported by TTDPatch 2.52.5Bit switch
01experimentalfeatures/-XFNot supported by OpenTTD Supported by TTDPatch 2.52.5Bit switch
02morevehicles/-xNot supported by OpenTTD Supported by TTDPatch 2.52.5Vehicle array multiplier
03mountains and curves/-mcNot supported by OpenTTD Supported by TTDPatch 2.52.5Two bytes with four sets of two bits
04planecrashcontrol/-XcNot supported by OpenTTD Supported by TTDPatch 2.52.5Bit switch
05autorenew/-XaNot supported by OpenTTD Supported by TTDPatch 2.52.5Signed value
06multihead/-MNot supported by OpenTTD Supported by TTDPatch 2.52.5Speed increase, in percent
07disasters/-XDNot supported by OpenTTD Supported by TTDPatch 2.52.5Bit switch
08unifiedmaglev/-XMNot supported by OpenTTD Supported by TTDPatch 2.52.5Unified maglev mode
09bridgespeedlimits/-XXNot supported by OpenTTD Supported by TTDPatch 2.52.5Speed fraction, in percent
0A---Not supported by OpenTTD Supported by TTDPatch 2.52.5TTD Language, see the "new scheme" for action 4
0Bstartyear/-XYSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5Year-1920
0Cmorebuildoptions/-YBNot supported by OpenTTD Supported by TTDPatch 2.52.5Bit switch
0Dmoresteam/-YMNot supported by OpenTTD Supported by TTDPatch 2.52.5value=LF (two hex digits), L=length, F=frequency
0Efreighttrains/-YfSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5weight factor
0Fwagonspeedlimits/-YLSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5Speed increase for empty wagons
10planespeed/-YPSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5speed factor
11dual company colorsSupported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (r1404)2.52CC colormap base sprite
12miscmods2/-ZmNot supported by OpenTTD Supported by TTDPatch 2.6 (r1738)2.6Bit switch
13map size informationSupported by OpenTTD 0.6 (r11961)0.6 Supported by TTDPatch 2.6 (r1817)2.6Format = -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

14maximum height levelSupported by OpenTTD 1.2 (r23158)1.2 Not supported by TTDPatchMaximal possible height level of a tile. Currently fixed at 15.

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.

Personal tools
advertisement