Fisunaama 1 Posted July 18, 2018 Hey, I'm making a scenario where if a member of a group's health drops below 50 the unit will unassign itself from the group and independently retreat. How would I script this sort of a .sqf? - Fisunaama Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted July 18, 2018 To check if at least one member is injured above 50%: _groupHasInjured = {damage _x >= 0.5} count units group player >= 1;//returns true if at least one soldier is hurt above 50% Cheers 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted July 18, 2018 this should make it so if one of the units health is below 50, he is removed from the group and runs towards a waypoint called retreatMarker { if (_x getDammage < 0.5) then { _x joinSilent grpNull; _wp = (group _x) addWaypoint [getMarkerPos "retreatMarker", 0]; _wp setWaypointType "MOVE"; }; } forEach (group player); 1 Share this post Link to post Share on other sites
Fisunaama 1 Posted July 18, 2018 Thank you, Much appreciated! I fixed some lines and put it in the init.sqf to run. _groupHasInjured = {damage _x >= 0.5} count units group player >= 1; { if ((damage _x == 0.5) && (_grouphasinjured)) then { [_x] joinSilent grpNull; _wp = (group _x) addWaypoint [getMarkerPos "retreatMarker", 0]; _wp setWaypointType "MOVE"; }; } forEach units group player; sleep 0.1; - Fisunaama 1 Share this post Link to post Share on other sites