×
Меню
Индекс

MSFD Controlling sound

 
StopSound, "Sound ID"
 
     Object_ID->StopSound "Lava Layer"
 
stops the sound "SoundID" if it is currently playing in the calling object.
 
GetSoundPlaying, "sound ID"     (returns Boolean/short)
 
     if ( GetSoundPlaying "lava layer" == 0 )
 
Returns 1 when the specified sound is currently playing on the calling object. The sound ID's can be found in the Gameplay menu /sounds and /sound gen, where you can also set up your own (see below for formats). This function can be used to control sounds, but also to gain information, because certain sounds are tied to certain events in game, e.g. the "Critical Damage" sound or the "Disarm trap" sound.
Sample Script: This simple script ensures that lava always has its rumble sound playing:
begin lava
 
if ( menumode == 1 )
     return
endif
 
if ( CellChanged == 0 )
     if ( GetSoundPlaying "lava layer" == 0 )
          PlayLoopSound3DVP "lava layer", 1.0, 1.0
     endif
endif
 
end lava