OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: mikieman on 12 Sep 2002, 19:36:29
-
how do i make it so musicplays in a loop and only plays whilst im inside the perimiter of a trigger?
btw. i already have the music in ofp
mikieman
-
Create the trigger and group it with the player. NOw select it as "Repeatedly". Activation vehicle -you must have the trigger grouped with the player-, Present.
Create a init.sqs file:
musicon=false
[x,x] exec "loop.sqs". Where X put (twice) the lenght in seconds of the song.
On Activation: playmusic "musictrack"; 0 fademusic 0.5; musicon=true
On Deactivation: 0 fademusic 0; musicon=false
About the loop... I can't figure out anything. Hope anybody cleverer than me will come up with something.
Well perhaps something with a script, let's call it: loop.sqs
_time = this select 0
_timeb = this select 1
_time2 = this select 2
#loop
? (musicon) AND (_time2 == 0) : goto "again"
? !(musicon) : goto "wait"
~1
_time2 = _time - 1
goto "loop"
#again
playmusic "musictrack"
_time = _timeb
goto "loop"
#wait
_time = _timeb
? (musicon) : goto "loop"
goto "wait"
I think that might work. I hope it. I'm not very good at scripting though