Page 1 of 1

AmbientStop doesnt work

Posted: May 24th, 2007, 3:55 pm
by waywaaaard
hi i wanna stop the ambientsound and start it again after playing another sound

Code: Select all

haloroom()
{
speakerhalo =  getent ("speaker_halo", "targetname");
halotrig = getent ("halo_trigger", "targetname");
while(1)
{
halotrig waittill ("trigger");
AmbientStop(2);
speakerhalo playsound("lev_facilities_sound7");
wait(117);
AmbientPlay("ambient_mp_lev_facilities");
}
}

Posted: May 24th, 2007, 8:18 pm
by Nightmare
I am pretty sure that you cannot stop ambient, it is something that loops in the background non-stop.

Posted: May 24th, 2007, 10:24 pm
by waywaaaard
but why exists then such a function?

Posted: May 24th, 2007, 11:19 pm
by Luke
I couldn't get it to work either, so either were doing it wrong or it could be an SP function only.

As a simple workaround you could create another alias in your csv with a vol_min of 0, and use ambientplay on that to stop it.

Posted: May 25th, 2007, 6:56 am
by Soviet
maybe you need to incorporate the ambient music as a script that has a starting state of on which turns off when the trigger is activated. Similar to on-off death triggers or situational triggers.

Posted: May 25th, 2007, 8:45 am
by waywaaaard
i will try to work it out with the vol_min 0

Posted: May 25th, 2007, 8:56 pm
by Nightmare
soviet, even if it was in a script it would keep on playing until it ended. Your best shot would be with what luke said, try the vol_min 0