OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Killzone on 24 Aug 2007, 17:03:10
-
Hi,
I was wondering is it possible to have members of a group move to a 2nd location once they get close enough to the target. I dont want to have to name all group members in case they die and are replaced by reinforcements. I am using this and it does not work
======
#move1
grp1 move getpos point1
? (_grp1 distance point1) < 7 : goto "move2"
~4
goto "move1"
#move2
grp1 move getpos point2
?(_grp1 distance point2) < 10 : goto "move3"
~4
goto "move2"
#move3
grp1 move getpos point3
?(_grp1 distance point3) < 8 : goto "move1"
~4
goto "move3"
=======
They move to point 1 using: grp1 move getpos point1
but they wont move on after that no matter what I set the distance at.
Thanks in advance for the help :D
-
if the code lines are exactly the script u are running its no wonder that only grp1 moves:
in the 1st condition you are testing group _grp1 but this variable is not assigned anywhere.
this way the condition always delivers "false" and your script keeps looping to #move1 forever.
grp1 is a public variable which you possibly declared inside the Editor.
_grp1 is a private variable just valid inside your script but as mentioned its not assigned anywhere in your script
Either you assgin those ( _grp1=grp1, _grp2=grp2, etc) or just simply use grp1, grp2,.. instead of private vars in your conditions like f.e.:
? (grp1 distance point1) < 7 : goto "move2"