AmbientSound

From ZDoom Wiki
Jump to navigation Jump to search
This page is for the ACS function. You might be looking for the actor instead.

void AmbientSound(str sound, int volume);

Usage

Plays a world sound (all players can hear it at the same volume, regardless of how close to the activator they are). Volume is an integer range from 0 to 127, with 127 being full volume and 0 being muted.

Examples

This script waits for all monsters tagged with tid 1 to die, and the plays a victory fanfare sound which is audible to all players, regardless of where they are.

script 1 (void)
{
   // Wait for all tid 1 monsters to die
   while( ThingCount(T_NONE, 1) > 0 )
   {
      delay(4);
   }
 
   // Play a victory noise for all players at full volume
   AmbientSound("handel/messiah", 127);
}