VariationalAction2/Road Stops

From GRFSpecs
< VariationalAction2
Revision as of 19:53, 19 October 2023 by Jgr (talk | contribs) (Add non-parameterised variables)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

Variables

Variable Size Version Description
40 B Supported by OpenTTD 1414 Not supported by TTDPatch View/rotation
41 B Supported by OpenTTD 1414 Not supported by TTDPatch Stop type
42 W Supported by OpenTTD 1414 Not supported by TTDPatch Tile information, see below
43 D Supported by OpenTTD 1414 Not supported by TTDPatch Road type
44 D Supported by OpenTTD 1414 Not supported by TTDPatch Tram type
45 D Supported by OpenTTD 1414 Not supported by TTDPatch Get town zone and Manhattan distance of closest town
46 D Supported by OpenTTD 1414 Not supported by TTDPatch Get square of Euclidian distance of closest town
47 B Supported by OpenTTD 1414 Not supported by TTDPatch Player (company) information
48 See Base Stations.
49 B Supported by OpenTTD 1414 Not supported by TTDPatch Current animation frame
60-65 See Base Stations.
66 D Supported by OpenTTD 1414 Not supported by TTDPatch Animation frame of nearby tile
67 D Supported by OpenTTD 1414 Not supported by TTDPatch Land info of nearby tiles
68 D Supported by OpenTTD 1414 Not supported by TTDPatch Road stop info of nearby tiles
6A D Supported by OpenTTD 1414 Not supported by TTDPatch GRFID of nearby tiles
69 See Base Stations.

Description

View/rotation (40)

Value Type Description
0 Bay Facing north-east
1 Bay Facing south-east
2 Bay Facing south-west
3 Bay Facing north-west
4 Drive-through X-axis: north-east to south-west
5 Drive-through Y-axis: north-west to south-east

Stop type (41)

Value Meaning
0 Passenger/bus stop
1 Freight/lorry stop

Tile information (42)

The return value has the same values as object var41.

Road type (43)

This has the value of the (translated) roadtype the road stop is built on, or the current roadtype in the build GUI.

If the roadtype has no entry in the roadtype translation table of the GRF, this value will be FFh.

If no translation table is present, the raw value will be returned.

Note: only exact matches of roadtypes are reported. If the translation table of the GRF does not contain the exact roadtype FFh is returned.

If the tile has no road at all (tram only) FFFFFFFFh is returned.

Tram type (44)

This has the value of the (translated) tramtype the road stop is built on, or the current tramtype in the build GUI.

If the tramtype has no entry in the tramtype translation table of the GRF, this value will be FFh.

If no translation table is present, the raw value will be returned.

Note: only exact matches of tramtypes are reported. If the translation table of the GRF does not contain the exact tramtype FFh is returned.

If the tile has no tram at all (road only) FFFFFFFFh is returned.

Get town zone and Manhattan distance of closest town (45)

Like industry var65 but instead of an offset the current tile is used.

Get square of Euclidian distance of closest town (46)

Like industry var66 but instead of an offset the current tile is used.

Player (company) information (47)

The return value has the same values as vehicle var43. The company used is the road stop owner.

Animation Frame (49)

The return value is the animation frame of the current tile.

Animation frame of nearby tile (66)

The parameter of this variable is a signed offset from the current tile.

If the selected tile is a road stop tile that belongs to the current station, its animation state is returned. Otherwise, FFFFFFFFh is returned.

Land info of nearby tiles (67)

The parameter of this variable is a signed offset from the current tile.

Returns the same values as industry tile var60.

Road stop info of nearby tiles (68)

The parameter of this variable is a signed offset from the current tile.

The returned value is FFFFFFFFh if the selected tile isn't a road stop tile. Otherwise, the returned value can be separated to the following parts:

Bits Meaning
0..7 If the tile is defined in the current GRF, this is the setID used in the definition. Otherwise, the content is undefined.

Note that this field is clamped to the range 0..255. Therefore if the current GRF defines road stops with a setID > 255, this field may only be used to check for road stops in the range 0..254.

8..9 0 - The tile uses original TTD graphics

1 - The tile is defined in the current GRF

2 - The tile is defined in another GRF

10 Set if the selected tile belongs to the current station, clear otherwise
11 Set if the selected tile has a different view/rotation, cleat if the same view/rotation
12..15 View/rotation of the selected tile
16..19 0 - Passenger/bus stop

1 - Freight/lorry stop

20 Set if the stop type (passenger/bus or freight/lorry) is the same as the current tile
21..31 Undefined, reserved for future use

GRFID of nearby road stop tile (6A)

The parameter of this variable is a signed offset from the current tile.

The returned value is one of the following:

  • FFFFFFFFh if the selected tile isn't a road stop tile
  • 00000000h if the selected station is a default road stop (not a NewGRF road stop)
  • otherwise, the GRFID of the GRF which defined the type of the selected road stop tile