Hi again. After the great help I got in getting a couple of nasties to hunt me down (works fine now), I'm stuck on something related.
The script I'm now using for the hunt is this:
_huntSquad = group _this select 0
#loop
[_huntSquad,0] setwppos getpos player
[_huntSquad,1] setwppos getpos player
[_huntSquad,2] setwppos getpos player
[_huntSquad,3] setwppos getpos player
[_huntSquad,4] setwppos getpos player
[_huntSquad,5] setwppos getpos player
[_huntSquad,6] setwppos getpos player
[_huntSquad,7] setwppos getpos player
~20
?(alive player):goto "loop"
exit
Basically, I have waypoints 0 to 7 preset for the group, I kill one, and the other two then come after me.
What I want to do is use the script for any group, and set any number of waypoints they may have to point to me and update regularly as above. I think I need a While loop to set all their waypoints, no matter how many they have? Perhaps something like:
_huntSquad = group _this select 0
#loop
_n = 0
while [_huntSquad,n] not null {
[_huntSquad,n] setwppos getpos player;
n=n+1;
}
~20
?(alive player):goto "loop"
exit
I can't get it to work - help greatly appreciated.
Edit:
bedges gave me code something like this, which works with the final waypoints in a Cycle:
#loop
[natashas_group, 8] setwppos getpos player
[natashas_group, 9] setwppos getpos player
~10
?(Alive player):goto "loop"
exit
Should I perhaps use the final wo waypoints idea, and then somehow find their number in the group list? If so, how would I find the number of the last waypoint for any group?
Boggled brain, again :-\
'nother edit:
Should I test if the group is dead at the start of the script? I tried the following, but it gives an error:
if (_squada == GrpNull){ exit };