Ambient sounds - Doom Legacy Wiki

Ambient sounds

From Doom Legacy Wiki

Jump to: navigation, search
Editing Tutorials

Ambient sound allows for atmospheric effects in your maps. With a little FraggleScripting, they can easily be implemented in the game. Here's an example. It plays a random sound at random intervals.

script 33
{
 int wait1 = (0);
 int wait2 = (0);
 while(1)
 {
  wait(30);
  wait1 = rnd() % 15;
  if(wait1 <= 2)
  {
   wait2 = rnd() % 3;
   if(wait2 == 1)
   {
    ambientsound(<soundname1>);
   }
   elseif(wait2 == 2)
   {
    ambientsound(<soundname2>);
   }
   else
   {
    ambientsound(<soundname3>);
   }
  }
 }
}

startscript(33);

All you have to do is replace any <soundname#> with the name of a sound lump. Example: ambientsound("FFHUM"); Note the DS is ommited.

Personal tools