OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Burn on 09 Jul 2003, 10:46:58
-
Hi all :wave:... just another of my syntax probs here again ;) take a look at this little buggy thing:
_law = wglaw
_law SetCombatmode "RED"
_law SetBehaviour "COMBAT"
_law SetSpeedMode "FULL"
#killrmor
"_x reveal rmor" foreach units _law
"_x domove getpos rmor" foreach units _law
"_x doTarget rmor" foreach units _law
~60
(count crew rmor > 2) or (getdammage rmor < 0.6):goto "killrmor"
(count crew rmor < 2) or (getdammage rmor > 0.6):goto "killbmp"
#killbmp1
"_x reveal bmp1" foreach units _law
"_x domove getpos bmp1" foreach units _law
"_x doTarget bmp1" foreach units _law
~10
(count crew bmp1 > 2) or (getdammage bmp1 < 0.6):goto "killbmp1"
(count crew bmp1 < 2) or (getdammage bmp1 > 0.6):goto "killbmp2"
#killbmp2
"_x reveal bmp2" foreach units _law
"_x domove getpos bmp2" foreach units _law
"_x doTarget bmp2" foreach units _law
~10
(count crew bmp2 > 2) or (getdammage bmp2 < 0.6):goto "killbmp2"
(count crew bmp2 < 2) or (getdammage bmp2 > 0.6):goto "killbmp"
#killbmp
"_x reveal bmp" foreach units _law
"_x domove getpos bmp" foreach units _law
"_x doTarget bmp" foreach units _law
~60
(count crew bmp > 2) or (getdammage bmp < 0.6):goto "killbmp"
(count crew bmp < 2) or (getdammage bmp > 0.6) && (count crew bmp1 < 2) or (getdammage bmp1 > 0.6) && (count crew bmp2 < 2) or (getdammage bmp2 > 0.6) && (count crew rmor < 2) or (getdammage rmor > 0.6):goto "follow"
#follow
[ap, at, 10, 5, 3] exec "follow.sqs"
exit
There's something wrong with the count crew thingy, but I don't know what... anyone know ???
Thanks in advance loons ;D(http://www.gamers-forums.com/smilies/contrib/monsieurboo/overclocking.gif)(http://216.40.249.192/s/ups/DeNiro/tylerdurdensays.gif) :o :P ;D
-
Well, your script is very specific to the units you have created, so it's hard to test it.
Two remarks, though :
1) There is no question mark each time you test the number of "rmor" :
(count crew rmor > 2) or (getdammage rmor < 0.6):goto "killrmor"
(count crew rmor < 2) or (getdammage rmor > 0.6):goto "killbmp"
should be :
? (count crew rmor > 2) or (getdammage rmor < 0.6):goto "killrmor"
? (count crew rmor < 2) or (getdammage rmor > 0.6):goto "killbmp"
2) What happens when crew rmor is equal to 2 ? Shouldn't you add a "=" somewhere ?
-
What happens when crew rmor is equal to 2 ? Shouldn't you add a "=" somewhere ?
You mean like this?:
? (count crew rmor >= 2) or (getdammage rmor < 0.6):goto "killrmor"Thanks for the help Igor! :thumbsup:
-
Yes that's what I meant.
:cheers:
-
I finally got home and tested it, and it seems to work :D (atleast no error mesages ::)).
Thanks a lot Igor I owe you one ;) :thumbsup:
:cheers: