Callback: Ambient sound effects
From GRFSpecs
Jump to navigationJump to search
Ambient sound effects (144)
This callback is a generic callback for feature 0C (new sounds) used for playing ambient sound effects.
The 15-bit return value is the sound effect number. Values from 0 to 72 (dec) are TTD's built-in sound effects, values beyond that refer to the sounds from Action 11.
To decide whether to play a sound, and what sound to play, Var.Action 2 variable 10 holds the following information: THRRxxxt
Field | Meaning |
---|---|
T | Tile class, 0=bare land, 4=trees, 6=water |
H | Height of north corner of tile |
RR | 8 random bits |
xxx | Reserved |
t | Terrain type; 0 normal (grass), 1 desert, 2 rainforest, 4 on or above snowline |
This callback must be enabled by bit 4 in action D var 9E.