AmbientSoundPlay

From Prime-WoW Wiki
Jump to navigation Jump to search

Starts playing the ambient soundtrack of an area. <nwscript> void AmbientSoundPlay(

   object oArea

); </nwscript>

Parameters

oArea
The area that should start playing its ambient soundtrack.

Description

Starts playing oArea's ambient soundtrack.

Remarks

Contrast this with MusicBackgroundPlay(), which starts playing the area's ambient music.

You can change the ambient soundtrack for the area using AmbientSoundChangeDay() and AmbientSoundChangeNight().

To stop the soundtrack from playing, use AmbientSoundStop().

Version

1.22

Example

<nwscript> // A trigger's OnEvent script: void main() {

   // Stop the music.
   object oArea = GetArea(OBJECT_SELF);
   MusicBackgroundStop(oArea);

   // Change the ambient sound settings.
   AmbientSoundChangeDay     (oArea, 46);  // al_an_lizrdflk1
   AmbientSoundChangeNight   (oArea, 46);  // al_an_lizrdflk1
   AmbientSoundPlay          (oArea);      // In case it's off
   AmbientSoundSetDayVolume  (oArea, 100); // In case it's too quiet
   AmbientSoundSetNightVolume(oArea, 100); // In case it's too quiet

   // Start the music up again.
   DelayCommand(30.0, MusicBackgroundPlay(oArea));

} </nwscript>

See Also

functions: AmbientSoundChangeDay, AmbientSoundChangeNight, AmbientSoundStop



author: Iskander Merriman