OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Arctic on 19 Jun 2004, 20:58:26
-
Ok, i have finally started touching OFP again after an extended break. ...Feels good :P
Anywho. I am (or was) constructing a claymore mine trap for the player in some burned buildings. I wrote this simple script to lopp until the player walks into the area and sets off a trigger:
#minetrap1.sqs
#Start
?mine1: goto "blow"
~2
goto "Start"
#blow
mine1 setdammage 1
~0.05
mine2 setdammage 1
~0.05
mine3 setdammage 1
exit
Ok. Now I have a trigger that is set to execute with west-once. In the 'On Activation' line, I put:
mine1=true
In game, when I run into the area, I get the following error message:
'mine1|#|=true; reserved variable in expression'
I know the error is being produced off of the '=true' portion of the code. And I kind of remember there being a 'truevariable' command that I am supposed to use, however I can't remember and have tried it already to no avail.
Thanks ahead!
-
Mine1 is off course a reserved variable - just look at the
first thing you want to blow up.
mine1 setdammage 1
Why do you need your script looping until the player enters
the trigger area anyways?
Instead of saying in the onActivation field: mine1 = true,
you could simply say: [] exec "minetrap1.sqs"
And your script should then only look like below:
mine1 setdammage 1
~0.05
mine2 setdammage 1
~0.05
mine3 setdammage 1
exit
~S~ CD
-
Geeze I never even thought about the variable-name conflicts! Thank you for your quick response! I had it looping because I feared that the script would run anyways unless if I had a variable that would start it.