o5_ 7 Posted January 29, 2019 If I spawn a random group not knowing how many vehicles are in it or how many dismounted soldiers it has in it (assuming there are both), what's the easiest way (code) to mount all dismounted soldiers in vacant vehicles positions? Thanks for the help guys. Sent from my SM-G930F using Tapatalk Share this post Link to post Share on other sites
GEORGE FLOROS GR 4205 Posted January 29, 2019 Hello there o5_ ! Take a look here : Share this post Link to post Share on other sites
o5_ 7 Posted January 30, 2019 Hey George, thanks. I'm on my mobile and I'm having a hard time viewing the content in the link you sent. Is there a particular part that would benefit me? Again, thanks man.Sent from my SM-G930F using Tapatalk 1 Share this post Link to post Share on other sites
pierremgi 4694 Posted January 30, 2019 Here is a simple script spawning vehicles & units for a group, and move units in free cargo (the vehicles spawn with their crew anyway, using bis_fnc_spawnGroup) 0 = [] spawn { _assets = ["B_soldier_f","B_soldier_A_f","B_soldier_AAR_f","B_soldier_AAR_f","B_soldier_AR_f","B_soldier_AT_f","B_medic_f","B_truck_01_transport_F","B_LSV_01_armed_F","B_MBT_01_cannon_F"]; // or what you want _spawnGrp = []; For "_i" from 0 to (round random 30 max 8) do { _spawnGrp pushBack (selectRandom _assets) }; _grp = [ getMarkerPos "spawnHere", side player,_spawnGrp,[],[],[],[],[],180,false] call BIS_fnc_spawnGroup; // interesting part for you: //========================== _vehs = [_grp,true] call BIS_fnc_groupVehicles; _units = (units _grp select {isnull objectParent _x}); { _unit = _x; {if ( (_x emptyPositions "cargo") > 0) exitWith {_unit moveInCargo _x};nil} count _vehs; nil } count _units; }; 1 Share this post Link to post Share on other sites
o5_ 7 Posted January 31, 2019 Amazing, just what I was looking for! Thanks! 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4205 Posted February 1, 2019 22 hours ago, o5_ said: Thanks! You're welcome o5_ ! Share this post Link to post Share on other sites