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 General Discussion »Continuous script via trigger volume

Author Topic: Continuous script via trigger volume (4 messages, Page 1 of 1)
Moderators: Dennis

Banshee64
Joined: Dec 4, 2012

oify


Posted: Apr 18, 2017 09:07 PM    Msg. 1 of 4       
How would I make a working continuous script only run when the player is in a trigger volume?

Here's the script

(script continuous oblmusic
(sleep 100)
(sound_looping_predict "banshee64\music\atmosphere_01")
(sound_looping_start "banshee64\music\atmosphere_01" none 1)
(sleep 4440)
(sound_looping_stop "banshee64\music\atmosphere_01")
(sound_looping_predict "banshee64\music\atmosphere_03")
(sound_looping_start "banshee64\music\atmosphere_03" none 1)
(sleep 8300)
(sound_looping_stop "banshee64\music\atmosphere_03")
(sound_looping_predict "banshee64\music\atmosphere_04")
(sound_looping_start "banshee64\music\atmosphere_04" none 1)
(sleep 8400)
(sound_looping_stop "banshee64\music\atmosphere_04")
(sound_looping_predict "banshee64\music\atmosphere_06")
(sound_looping_start "banshee64\music\atmosphere_06" none 1)
(sleep 5490)
(sound_looping_stop "banshee64\music\atmosphere_06")
(sound_looping_predict "banshee64\music\atmosphere_07")
(sound_looping_start "banshee64\music\atmosphere_07" none 1)
(sleep 6150)
(sound_looping_stop "banshee64\music\atmosphere_07")
(sound_looping_predict "banshee64\music\atmosphere_08")
(sound_looping_start "banshee64\music\atmosphere_08" none 1)
(sleep 7460)
(sound_looping_stop "banshee64\music\atmosphere_08")
(sound_looping_predict "banshee64\music\atmosphere_09")
(sound_looping_start "banshee64\music\atmosphere_09" none 1)
(sleep 7370)
(sound_looping_stop "banshee64\music\atmosphere_09")
)


I'd like it so the sound_looping would kind of fade out where it is when the player leaves the trigger volume and picks back up where it was when the player reenters, I don't know if that specifically is possible; but in general how would I link the script to a trigger volume?


DeadHamster
Joined: Jun 8, 2014


Posted: Apr 19, 2017 08:03 AM    Msg. 2 of 4       


(script continuous SCRIPT_NAME
(if (volume_test_object TRIGGER_VOLUME PLAYER_OBJECT)
(begin
(wake oblmusic)
)
(sleep oblmusic)
)
)




Replace SCRIPT_NAME TRIGGER_VOLUME and PLAYER_OBJECT with your data.

When a player leaves the trigger volume, your script will stop playing. When they re-enter, your script will start playing.

This won't stop the song that very second, but it'll prevent any further commands (the next part of the song) from playing until the player has returned.
Edited by DeadHamster on Apr 19, 2017 at 08:04 AM


Banshee64
Joined: Dec 4, 2012

oify


Posted: Apr 19, 2017 01:49 PM    Msg. 3 of 4       
so the oblmusic script needs to be dormant?


DeadHamster
Joined: Jun 8, 2014


Posted: Apr 19, 2017 02:57 PM    Msg. 4 of 4       
Quote: --- Original message by: Banshee64
so the oblmusic script needs to be dormant?



Nope, just determine a variable for when it should start. For example



(global boolean safety_word 0)


(script startup activator

(sleep_until volume_test_objects my_arse (players)
(set safety_word 1)
)




(script continuous oblmusic

(sleep_until (= 1 safety_worD))


...stuff goes here...

)





(sleep) actually has another variable outside of the tick count


(sleep <short> [<script>]) pauses execution of this script (or, optionally, another script) for the specified number of ticks. (1 tick = 1/30 second (sleep 30 more_weapons



If the string is left blank, it defaults to the calling script.

You may actually have to use

(sleep -1 oblmusic)

instead, but either way you can force any script (dormant, stub, static, startup or continuous) to sleep for any time from any other script.





Edit:


Or this works as well;




(script continuous oblmusic
(sleep -1)

....stuff goes here...
)


(script startup activator

(sleep_until (volume_test_objects my_arse (players)) 5)

(wake oblmusic)

)


Edited by DeadHamster on Apr 19, 2017 at 03:09 PM

 

 
Previous Older Thread    Next newer Thread





Time: Sat October 21, 2017 1:42 PM 328 ms.
A Halo Maps Website