alleycat 28 Posted September 11, 2013 I would like to filter all living soldier units out of AllUnits (removing all non human units). How would I do that? IsKindOf "Man" can be used but I am not sure about syntax. Share this post Link to post Share on other sites
YattaYatta 10 Posted September 11, 2013 { deleteVehicle _x; } foreach vehicles; ... would remove all vehicles. Crew & passengers are not affected - except probably kinda surprised. Share this post Link to post Share on other sites
das attorney 858 Posted September 11, 2013 Try this: _vehicles_arr = []; { if (not _x isKindOf "Man") then { _vehicles_arr set [count _vehicles_arr, _x]; }; } forEach allUnits; Share this post Link to post Share on other sites
alleycat 28 Posted September 11, 2013 DOes that script add every unit that is not Man to the new array? Share this post Link to post Share on other sites
YattaYatta 10 Posted September 11, 2013 My bad I misunderstood the question. Attorney's exemple does what you asked for. Share this post Link to post Share on other sites
das attorney 858 Posted September 11, 2013 Yes, you can filter additional classes out as well if you need to by adding in more checks. For example - (All units that aren't men or aircraft): _vehicles_arr = []; { if (not _x isKindOf "Man" and not _x isKindOf "Air") then { _vehicles_arr set [count _vehicles_arr, _x]; }; } forEach allUnits; Is that what you meant? Share this post Link to post Share on other sites
zapat 56 Posted September 11, 2013 I would use "CAmanBase" instead of "Man", since "man" kind includes animals as well... BIS logic. True in some sense. :) I'm not sure if allUnits would include animals though... Share this post Link to post Share on other sites