dnk 13 Posted January 10, 2011 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
ffur2007slx2_5 11 Posted January 10, 2011 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
dnk 13 Posted January 10, 2011 (edited) 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 January 10, 2011 by DNK Share this post Link to post Share on other sites
GDICommand 10 Posted January 10, 2011 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
dnk 13 Posted January 11, 2011 (edited) 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 January 11, 2011 by DNK Share this post Link to post Share on other sites