OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: stephen271276 on 14 Sep 2009, 17:42:31

Title: Generate a Group?
Post by: stephen271276 on 14 Sep 2009, 17:42:31
Is there an easy way to Generate a group of varied soldiers? This is for a mission Im making which will have a reinforcements option via radio. Would also help if they would spawn about 30 metres behind the player...
Title: Re: Generate a Group?
Post by: celoush on 14 Sep 2009, 18:11:30
Code: [Select]
0 spawn {
_group = createGroup east;
for "_i" from 1 to 30 do {
_unit = _group createUnit ["MVD_Soldier", Position player, [], 30, "FORM"];
sleep 0.1;
};
Title: Re: Generate a Group?
Post by: Pirin on 16 Sep 2009, 08:49:43
You can use the Functions module and BIS_fnc_spawnGroup as well, as shown here:

Create a 30 man group:
Code: [Select]
_newGroup = [_pos, _side, 30] call BIS_fnc_spawnGroup;
http://forums.bistudio.com/showpost.php?p=1325686&postcount=26 (http://forums.bistudio.com/showpost.php?p=1325686&postcount=26)
Title: Re: Generate a Group? SOLVED
Post by: stephen271276 on 18 Sep 2009, 13:34:55
Pirin,

How exactly does that work? Do I have to download something or is it already part of the program? Sorry for noob questions.... Basically what Im asking is can I put that code in the init line of a trigger or WP?
Title: Re: Generate a Group?
Post by: Blacknite on 19 Sep 2009, 02:04:46
I would try and make it a script instead.