Jump to content
Sign in to follow this  
dnk

Emergency Waypoint?

Recommended Posts

When a script triggers, I want to set emergency waypoints for all groups to run to the nearest "base", wait, then return to a normal patrol. I cannot get this to work, though, and hope someone could help me.

My current attempt is:

_men0 = (getMarkerPos "base0") nearEntities ["Group",500];
//and other "bases"...

{_x addWaypoint [getMarkerPos "base0",20];
arrayways = waypoints _x;
thecount = count arrayways;
_x setCurrentWaypoint [_x,thecount];

sleep 60;

_x deleteWaypoint [_x,thecount];
_x setCurrentWaypoint [_x,1];
} forEach _men0;

What's wrong with that?

Share this post


Link to post
Share on other sites
When a script triggers, I want to set emergency waypoints for all groups to run to the nearest "base", wait, then return to a normal patrol. I cannot get this to work, though, and hope someone could help me.

My current attempt is:

_men0 = (getMarkerPos "base0") nearEntities ["Group",500];
//and other "bases"...

{_x addWaypoint [getMarkerPos "base0",20];
arrayways = waypoints _x;
thecount = count arrayways;
_x setCurrentWaypoint [_x,thecount];

sleep 60;

_x deleteWaypoint [_x,thecount];
_x setCurrentWaypoint [_x,1];
} forEach _men0;

What's wrong with that?

I think you should use

{_x move getMarkerPos "base0"} forEach _men0

Share this post


Link to post
Share on other sites

Yeah, that would probably be a lot, lot, lot simpler. Thanks!

But, there's still a problem: I can't get actual groups to move, only individuals. And, I need them to hold at the spot for a few minutes, and with move/domove they get there and immediately try to move on to the next WP again.

Edited by DNK

Share this post


Link to post
Share on other sites

i thought when you added a waypoint to a group, it wouldn't execute unless you assigned it some variable name...for some odd reason, it needs to be stored somewhere, even if you have no intention of using that variable name again. which is irrelevant anyway, as you could get it from the waypoints anyway if you needed it...anyway, just throwing that out there

Share this post


Link to post
Share on other sites

Seems to work fine.

I found a workaround:

_men0 = (getMarkerPos "base0") nearEntities ["Man",800];

{_x move (getMarkerPos "base0");
_x setSpeedMode "FULL";
_x setBehaviour "AWARE";
[b]_x lockWP true;[/b]
} forEach _men0;

sleep 120;

{[b]_x lockWP false;[/b]
} forEach _men0;

I'd note that move doesn't seem to add a permanent WP, just a temporary one that is erased as soon as it is reached. For example, if you have a group that cycles between 2 WPs, then use move, after they reach the move WP, they'll return to their 2-WP loop.

Edited by DNK

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×