A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Script question about trigger volume sounds

Author Topic: Script question about trigger volume sounds (6 messages, Page 1 of 1)
Moderators: Dennis

XlzQwerty1
Joined: Aug 6, 2009


Posted: Sep 28, 2010 06:49 PM    Msg. 1 of 6       
So I made a basic script that plays a sound looping once you enter it. But, when I leave the trigger volume, the sound still plays, is it possible to stop the sound once the player leaves the trigger volume?

Here is all I have:

Quote:
(script startup "Name Of Script"
(begin
(sleep_until (volume_test_objects "Name of Trigger Volume" (players)) 15)
(sound_looping_start "Name of .sound_looping" none 1)
)
)

Edited by XlzQwerty1 on Sep 28, 2010 at 06:50 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 28, 2010 07:55 PM    Msg. 2 of 6       
Quote: --- Original message by: XlzQwerty1
Quote:
(script startup "Name Of Script"
(begin
(sleep_until (volume_test_objects "Name of Trigger Volume" (players)) 15)
(sound_looping_start "Name of .sound_looping" none 1)
)
)



Let's do a literal play by play of your script.

(script startup "Name Of Script"
(begin
(sleep_until (volume_test_objects "Name of Trigger Volume" (players)) 15)
(sound_looping_start "Name of .sound_looping" none 1)
)
)


First line. This is a startup script, meaning your script will only execute once.
Second line. The begin is unnecessary, and can and will cause problems in the future.
Third line. You're sleeping until a player enters the trigger volume before executing the fourth line. Not sure if this is what you want. Read
Fourth line. You start playing the sound looping. This doesn't include ending it when you leave the trigger volume.

To suit your needs, I'm assuming that you want the script to play the sound looping every time you enter the trigger volume, and cut it once you leave.

(script continuous playshiz
(if
(volume_test_objects tvol (players))
(begin
(sound_looping_start soundloop none 1)
(sleep_until (not (volume_test_objects (players))) 15)
(sound_looping_stop soundloop)
)
)
)

Else, just use a startup, in your format, with an extra sleep until after you begin playing the sound looping, to end the sound looping.


XlzQwerty1
Joined: Aug 6, 2009


Posted: Oct 4, 2010 07:31 PM    Msg. 3 of 6       
Well a new problem here, I want the sound to only play to the client, not the server, is that possible? Also, it plays multiple instances of the sound when I walk in and out because my sound permutation is 2-3 seconds each.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Oct 6, 2010 05:27 AM    Msg. 4 of 6       
I think it will only play for the client, because it checks for the player, which is the person playing.

With your sound compression, it would be easier to just compile the entire sound into 1 ogg file with no permutations, then put it into a sound_looping. For some reason I have always had trouble with multiple permutations of a sound inside the loop portion of a sound_looping file.


XlzQwerty1
Joined: Aug 6, 2009


Posted: Oct 6, 2010 04:59 PM    Msg. 5 of 6       
Well, I tested this sound, and when I went ingame with my friend, he went into the trigger volume and the sound played for both of us.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Oct 6, 2010 05:48 PM    Msg. 6 of 6       
Lol, I have no idea then.
I didn't know sound_loopings not attached to objects sync'd.

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 3:11 AM 110 ms.
A Halo Maps Website