Skip to content

98 — Play Sound Effect (Random)...

Plays a sound effect at one of the waypoints the scenario has placed, chosen at random.

Editor data
Numeric ID
98
Engine ID
TACTION_PLAY_SOUND_RANDOM
Editor name
Play Sound Effect (Random)...
Need token
NEED_SOUND
Parameters
  1. Soundsound
Attachment
none
INI example
[Actions]
<TriggerID>=1,98,0,<Sound>,0,0,0,0,

The pick is made from a range running from zero to one below the number of waypoints gathered, and that range is never checked for being empty. A scenario that has placed no waypoint at all therefore asks for a pick between 0 and -1. A range given the wrong way round is put back in order rather than refused, so what comes back is 0 or -1 with about even odds, and the sound is positioned either from a list entry that was never filled in or from the memory immediately before the list. Either way the position is whatever happened to be there.

Caveats
  • Every placed waypoint is in the draw, the home, reinforcement and special waypoints included. A waypoint the scenario never placed is passed over.
  • The sound is positioned on the map rather than played flat, so it fades with the distance from the chosen waypoint to the view and is inaudible once that waypoint is far enough off screen.
  • The draw comes from the shared random sequence the simulation uses, so every machine picks the same waypoint.
  • The list the waypoints are gathered into holds a hundred entries, and the guard meant to stop the gathering compares the count against the list's size in bytes rather than its length, so it never fires. A scenario that has placed all one hundred and one waypoints writes one entry past the end of that list.