OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: thedog on 21 Feb 2009, 17:35:59
-
hey guys,
im not new but not that good at scripting and i ran into a problem. before i tell you whats wrong ill tell you what i want to achieve.
the mission is to go a radio station that plays propaganda music, you need to change the "cd" for the objective to be complete.
the propaganda music is a 16 second long audio file that i put on repeat if you wanna call it that.
so what i did is placed a trigger, when the player gets in a certain distance to the station he hears the propaganda music. so the trigger executes music1.sqs which looks like this =
#hook1
PlayMusic "prop"
~15.5
goto "hook1"
ok so now the player moves to the stereo and executes music2.sqs which pretty much just plays another sound file. now this sound file keeps getting cut out because the first one is still on that "loop". ive tried for hours to figure something out, went up and down forums, the wiki site and the editors guide, couldnt figure it out. im probably looking for the wrong thing :( also its probably stupid for me to have it in 2 seperate SQS files right? problem is, like i said im not new but im not that good at this. how do i either terminate the first one when the other one goes true? tried several things already :(
also another question, is there an IRC channel for editors??? ive heard of one
greets dog
-
You could try to use the command say (http://www.ofpec.com/COMREF/index.php?action=details&id=278) instead.
Have the stereo object (or use Game Logic instead) say the music, maybe that doesn't get cut off. :dunno:
-
Using the say command means that the sound emanates from an object instead of just being in the player's ears (or head, for that matter).
Place an object or Game Logic in the radio station booth and name it speaker.
Then your music1.sqs would look like:#hook1
speaker say "prop"
~15.5
goto "hook1"
but you want to change what the speaker says when the player changes the CD, so create an init.sqs file (or add the following line to one you already have):CDchanged = false
now by including the following in music2.sqs, music1.sqs will quit instead of repeatingCDchanged = true
so modify music1.sqs#hook1
if (CDchanged == true) then goto "end"
speaker say "prop"
~15.5
goto "hook1"
#end
exit
thus music2.sqs should look likeCDchanged = true
#hook2
speaker say "RadioFreeAmerica" <- whatever your alternative sound name is
~15.5
goto "hook2"