Difference between revisions of "Callback: Animation control"

From GRFSpecs
Jump to navigationJump to search
Line 39: Line 39:
 
|[[Action0/Airport_Tiles#Animation_triggers_via_callback_152_.2811.29|Property 11]]
 
|[[Action0/Airport_Tiles#Animation_triggers_via_callback_152_.2811.29|Property 11]]
 
|All triggers, see variable 18
 
|All triggers, see variable 18
  +
|Random bits <ref name="randombits15">{{ottdp|15|no}} Lower 16 bits are random per tile. Upper 16 bits are the same for all tiles, if the trigger applies to multiple tiles.</ref>
|Random bits
 
 
|Trigger and more, see [[Action0/Airport_Tiles#Animation_triggers_via_callback_152_.2811.29|property 11]]
 
|Trigger and more, see [[Action0/Airport_Tiles#Animation_triggers_via_callback_152_.2811.29|property 11]]
 
|-
 
|-
Line 45: Line 45:
 
|[[Action0/Objects#Animation_triggers_.2813.29|Property 13]]
 
|[[Action0/Objects#Animation_triggers_.2813.29|Property 13]]
 
|All triggers, see variable 18
 
|All triggers, see variable 18
|Random bits
+
|Random bits <ref name="randombits15" />
 
|Trigger and more, see [[Action0/Objects#Animation_triggers_.2813.29|property 13]]
 
|Trigger and more, see [[Action0/Objects#Animation_triggers_.2813.29|property 13]]
 
|}
 
|}

Revision as of 10:31, 25 April 2025

Animation control (1B/1C/25/140/148/152/159)

These callbacks are called, when an animation trigger happens.

Callback Feature Mask property Trigger Variable 10 Variable 18
1B Houses Property 14 bit 2 Periodic, see property 16 [1] Supported by OpenTTD Supported by TTDPatch 2.5 (beta 2)2.5 Random bits [2] Reserved for future use
1C Houses Property 14 bit 3 Construction stage changes [3] Reserved for future use Reserved for future use
25 Industry tiles Property 11 All triggers, see variable 18 Supported by OpenTTD Supported by TTDPatch 2.5 (beta 2)2.5 Random bits [4] Trigger and more, see property 11
140 Stations, road stops Station property 18, road stop property 10 All triggers, see variable 18 Supported by OpenTTD Supported by TTDPatch 2.5 (beta 2)2.5 Random bits [4] Trigger and more, see station property 18
148 Houses Property 1E Watched cargo accepted [5] Reserved for future use See property 1E
154 Airport tiles Property 11 All triggers, see variable 18 Random bits [6] Trigger and more, see property 11
159 Objects Property 13 All triggers, see variable 18 Random bits [6] Trigger and more, see property 13
  1. For multi-tile houses property 19 bit 2 controls, whether the trigger is synchronised across all house tiles. See details there.
  2. Lower 16 bits are random per tile. Upper 16 bits are the same for all tiles, if property 19 bit 2 is set.
  3. During normal gameplay called 4 times per tile. During map generation called 1 time.
    Supported by TTDPatch For the first call to happen, you also have to set property 9 bit 5.
  4. 4.0 4.1 Lower 16 bits are random per tile. Upper 16 bits are the same for all tiles, if the trigger applies to multiple tiles.
  5. Due to implementation details, up to 250 game ticks can pass between the actual acceptance and triggering this callback.
  6. 6.0 6.1 Supported by OpenTTD 1515 Not supported by TTDPatch Lower 16 bits are random per tile. Upper 16 bits are the same for all tiles, if the trigger applies to multiple tiles.

The return value has the format SSFF:

  • FF: One of the following values:
Value Meaning
00 - FC Jump to this animation frame.
FD leave the animation in its current state (do nothing)
FE start animation with its current frame
FF stop animation in its current frame
  • SS: Sound effect: If non-zero, the sound effect number to play at the tile.

Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.