xXPinkFloyd92Xx 11 Posted September 21, 2021 Hello, I want to create a group using a function.sqf: fnc_createGrouplost = { private ["_pos", "_grp"]; if (isNil {_this}) exitWith {grpNull;}; if (typename _this != "ARRAY") exitWith {grpNull;}; _pos = _this; _grp = createGroup west; "C_man_hunter_1_F" createUnit [_pos, _grp,"",0.5, "CORPORAL"]; "C_man_hunter_1_F" createUnit [_pos, _grp,"",0.5, "PRIVATE"]; "C_man_hunter_1_F" createUnit [_pos, _grp,"",0.5, "PRIVATE"]; "C_man_hunter_1_F" createUnit [_pos, _grp,"",0.5, "PRIVATE"]; _grp; }; ------------------------------------------------------------------------------------- This worked fine. I am using ACE medical for this mission (CSAR) I wanted to add this group with some wounded. How can I give individuals a specific inti? The init I want to add to the unit: this setVariable ["ace_medical_ai_lastFired", 9999999];[this, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit; [this, 0.8, "leftleg", "bullet"] call ace_medical_fnc_addDamageToUnit any ideas? Share this post Link to post Share on other sites
wogz187 1086 Posted September 21, 2021 @xXPinkFloyd92Xx, Spoiler fnc_createGroupLost= { if isNil '_this' exitWith {false}; private _grp = createGroup [WEST, true]; for "_i" from 0 to 3 do {_grp createUnit ["C_man_hunter_1_F", _this, [], 0, "FORM"]}; _grp }; (units ((player modelToWorld [0,5,0]) call fnc_createGrouplost)) apply { _x setVariable ["ace_medical_ai_lastFired",9999999]; [_x, 0.8, "rightleg","bullet"] call ace_medical_fnc_addDamageToUnit; [_x, 0.8, "leftleg","bullet"] call ace_medical_fnc_addDamageToUnit }; Have fun! Share this post Link to post Share on other sites
xXPinkFloyd92Xx 11 Posted September 21, 2021 I edited the Function.sqf with your fix but the init is still not working as you can see from the screens it creates the group but no injured ai. I may have done this wrong any advice is greatly appreciated thank you. I have some screens:https://ibb.co/2YGtXSThttps://ibb.co/44R0r5Mhttps://ibb.co/NmXjdHghttps://ibb.co/L0mCt97https://ibb.co/hfFhL4S Share this post Link to post Share on other sites
wogz187 1086 Posted September 21, 2021 @xXPinkFloyd92Xx, I don't have ACE installed so I tested with, (units ((player modelToWorld [0,5,0]) call fnc_createGrouplost)) apply {systemChat str _x}; I can't account for what happens inside the apply scope. 1 Share this post Link to post Share on other sites