Difference between revisions of "VariationalAction2/Road Stops"

From GRFSpecs
Jump to navigationJump to search
(Initial variable table)
 
(Add parameterised variables)
Line 27: Line 27:
 
|60-65|| || ||See [[VariationalAction2/BaseStation|Base Stations]].
 
|60-65|| || ||See [[VariationalAction2/BaseStation|Base Stations]].
 
|-
 
|-
|66||W||{{ottdp|14}}||Animation counter of nearby tile
+
|66||D||{{ottdp|14}}||Animation counter of nearby tile
 
|-
 
|-
 
|67||D||{{ottdp|14}}||Land info of nearby tiles
 
|67||D||{{ottdp|14}}||Land info of nearby tiles
Line 39: Line 39:
   
 
== Description ==
 
== Description ==
  +
  +
=== Animation counter 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 [[VarAction2IndustryTiles#Land info of nearby tiles (60)|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 has more than 256 road stops, 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

Revision as of 19:35, 19 October 2023

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 counter 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

Animation counter 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 has more than 256 road stops, 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