OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ghost644 on 27 May 2006, 15:45:02
-
I would like this script to end after a certain amount of time, or even better when a trigger is activated.
#loop
_ran = random 8
? (_ran <= 1) : goto "one"
? (_ran <= 2) : goto "two"
? (_ran <= 3) : goto "three"
? (_ran <= 4) : goto "four"
? (_ran <= 5) : goto "five"
? (_ran <= 6) : goto "six"
? (_ran <= 7) : goto "seven"
? (_ran <= 8) : goto "eight"
#one
bomb = "heat120" camcreate (getpos g1)
goto "end"
#two
bomb2 = "heat120" camcreate (getpos g2)
goto "end"
#three
bomb3 = "heat120" camcreate (getpos g3)
goto "end"
#four
bomb4 = "heat120" camcreate (getpos g4)
goto "end"
#five
bomb5 = "heat120" camcreate (getpos g5)
goto "end"
#six
bomb6 = "heat120" camcreate (getpos g6)
goto "end"
#seven
bomb7 = "heat120" camcreate (getpos g7)
goto "end"
#eight
bomb8 = "heat120" camcreate (getpos g8)
goto "end"
#end
~5
goto "loop"
-
In the trigger On Activation field, type:
StopBarrage=true;
Now, modify the script so it looks like this:
#loop
?StopBarrage: exit
_ran = random 8
? (_ran <= 1) : goto "one"
? (_ran <= 2) : goto "two"
? (_ran <= 3) : goto "three"
? (_ran <= 4) : goto "four"
? (_ran <= 5) : goto "five"
? (_ran <= 6) : goto "six"
? (_ran <= 7) : goto "seven"
? (_ran <= : goto "eight"
#one
bomb = "heat120" camcreate (getpos g1)
goto "end"
#two
bomb2 = "heat120" camcreate (getpos g2)
goto "end"
#three
bomb3 = "heat120" camcreate (getpos g3)
goto "end"
#four
bomb4 = "heat120" camcreate (getpos g4)
goto "end"
#five
bomb5 = "heat120" camcreate (getpos g5)
goto "end"
#six
bomb6 = "heat120" camcreate (getpos g6)
goto "end"
#seven
bomb7 = "heat120" camcreate (getpos g7)
goto "end"
#eight
bomb8 = "heat120" camcreate (getpos g8)
goto "end"
#end
~5
goto "loop"
-Pilot
-
Holy crap! Talk about easy, sigh i hate being a newb. Thankyou soo much!