Callback: Ambient sound effects: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
m Create a separate page for each callback |
mNo edit summary |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 5: | Line 5: | ||
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 [[Action11|Action 11]]. |
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 [[Action11|Action 11]]. |
||
To decide whether to play a sound, and what sound to play, Var.Action 2 variable 10 holds the following information: |
To decide whether to play a sound, and what sound to play, Var.Action 2 variable 10 holds the following information: |
||
* {{grfTill|7}} For GRF version 7 and below: THRRxxxt |
|||
* {{grfFrom|8}} For GRF version 8 and above: xTHHRRtt |
|||
{| |- |
{| |- |
||
| Line 12: | Line 14: | ||
|T||Tile class, 0=bare land, 4=trees, 6=water |
|T||Tile class, 0=bare land, 4=trees, 6=water |
||
|- |
|- |
||
|HH|| |
|||
| |
{{grfTill|7}} Height of north corner of tile (multiple of 8)<br/> |
||
{{grfFrom|8}} Height of lowest corner of tile (multiple of 1) |
|||
|- |
|- |
||
|RR||8 random bits |
|RR||8 random bits |
||
| Line 18: | Line 22: | ||
|xxx||Reserved |
|xxx||Reserved |
||
|- |
|- |
||
|tt|| |
|||
* Bits 0..2: Terrain type: 0 normal (grass), 1 desert, 2 rainforest, 4 on or above snowline. |
|||
* Bits 3..5: {{grfFrom|8}} Water class: 0 - undefined / land; 1 - sea; 2 - canal; 3 - river. |
|||
|} |
|} |
||
This callback must be enabled by bit 4 in [[ |
This callback must be enabled by bit 4 in [[GlobalVariables#Misc._GRF_Features_.281E_.2F_9E.29|action D var 9E]]. |
||
[[Category:Callbacks]] |
[[Category:Callbacks]] |
||
Latest revision as of 00:25, 29 October 2025
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:
- GRFv≤7 For GRF version 7 and below: THRRxxxt
- GRFv≥8 For GRF version 8 and above: xTHHRRtt
| Field | Meaning |
|---|---|
| T | Tile class, 0=bare land, 4=trees, 6=water |
| HH |
GRFv≤7 Height of north corner of tile (multiple of 8) |
| RR | 8 random bits |
| xxx | Reserved |
| tt |
|
This callback must be enabled by bit 4 in action D var 9E.