Jump to content
tommytom1

Make Groups Disembark on marker using distance2D

Recommended Posts

Can someone tell my whats wrong with this code, im using it OnAct for a trigger 

 

opfor_units_array = []; 
opfor_units_array pushBack group opfor_soldiers; 
opfor_units_array pushBack group opfor_soldiers1; 
opfor_units_array pushBack group opfor_soldiers2; 
opfor_units_array pushBack group opfor_soldiers3; 
opfor_units_array pushBack group opfor_soldiers4; 

{
    if (getMarkerPos "retreat_marker" distance2D (leader _x) < 5) then {
        _x orderGetOut true; 
    };
    _x move (getMarkerPos "retreat_marker"); 
} forEach opfor_units_array;


Im just trying to make each group disembark when they reach the retreat marker. But make it so just the group(s) that reach the marker disembark and not the ones who haven't yet.

Share this post


Link to post
Share on other sites

Command orderGetOut doesn't exist. Use doGetOut with combination of orderGetIn FALSE, allowGetIn FALSE or leaveVehicle. Also pay attention for commands syntax. Some commands needs units array instead of group.

Share this post


Link to post
Share on other sites

thx i ended up using
opfor_units_array = [opfor_soldiers,opfor_soldiers1,opfor_soldiers2,opfor_soldiers3,opfor_soldiers4];   
    {
_x Move (getMarkerPos "retreat_marker"); 
} forEach opfor_units_array;

and then a seperate trigger with allowGetIn false to disembark them , theres probably an better way to do it but this was easier and it works 😄

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

×