Horner 13 Posted July 3, 2011 Is there a way to make a random amount of enemy infantry,armor,etc. spawn around a marker but only once? Because I want to make it so once you clear the area that it is clear and no more enemies spawn. But, I want the amount of enemies to be random. Can someone help? Share this post Link to post Share on other sites
demonized 20 Posted July 3, 2011 use BIS_fnc_spawnGroup to do this, look in link for randomisation controls, mandatory is minimum amount of units, set it to for example 1, and second number is chance percent of the rest, 0-1 for example 0.5 (50%) - i think it was 0.5 for 50 percent, test if 50 works etc. _group = [getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1","T72_RU"],[],[],[],[],[[b]1,0.5[/b]],180] call BIS_fnc_spawnGroup; note that the same side must be correct for all units. Share this post Link to post Share on other sites
Horner 13 Posted July 3, 2011 thanks demonized ill test it out Share this post Link to post Share on other sites
mikie boy 18 Posted August 7, 2011 in continuation of this question.... how would you name each person spawned in order to allow them each individually to have an add action. ive used the call BIS_fnc_spawnGroup method - but no joy. ive created a single unit at each marker via - _terrorhelpers = createAgent [_bossmantype, getMarkerPos format ["helperSpot%1",_i], [], 0, "NONE"]; for "_i" from 0 to 9 do { call compile format[' _terrorhelper setVehicleInit " this setVehicleVarName ""terrorhelper%1""; terrorhelper%1 = this; "; ', _i]; }; and called the add action with... _interroraction = terrorhelper addAction ["Interrogate","interror.sqf",[true],1,false]; my markers appear - the above civies appear at location - but no add action. thus no joy. any takers - taken me hours to get nowhere Share this post Link to post Share on other sites
demonized 20 Posted August 7, 2011 _group = [getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1","T72_RU"],[],[],[],[],[1,0.5],180] call BIS_fnc_spawnGroup; { _interroraction = _x addAction ["Interrogate","interror.sqf",[true],1,false]; } foreach units _group; but beware that addaction is a local command so if it is for MP mission, you need to spawn the group on server only, then spawn the action on all clients. Share this post Link to post Share on other sites
mikie boy 18 Posted August 7, 2011 cheers Demonized - turns out using create agent is more of a pain in the butt than its worth. but that did the trick nicely thanks again Share this post Link to post Share on other sites