ThingSound
Note: This function has been superseded by PlaySound, which duplicates and extends its functionality. Use of the newer function is advised in order to maintain maximum flexibility in your code. |
void ThingSound (int tid, str sound, int volume);
Usage
Plays a sound at a thing. This is a point sound, so anyone far away will not hear it as loudly.
Examples
This script shuts down some kind of generator in the level. The sound source is an object close to the generator so when the player hits the switch to turn it off, they hear the powering down sound coming from the generator.
script 1 (void) { // Message to the player Print(s:"Generator shut down. Rear hatch access granted."); // Turn off the generator lights Light_ChangeToValue(1, 144); Light_ChangeToValue(2, 96); // Play a shutdown sound from the generator ThingSound(1, "ambient/poweroff", 127); }
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.