Jump to content
ALPHIVE

How make unit spawn in trigger with gear ?

Recommended Posts

Hi everybody :)

 

I have a little problem : i make spawn IA through trigger with activation, i use  this command in activation box :

 

missionNamespace setVariable ["BAS_unitObject", (createGroup east) createUnit ["O_recon_F", thisTrigger, [], 0, "NONE"]];

 

It works well but i dont know how to add to them the following gear when they spawn :/

 

["O_recon_F",[["arifle_AK12_F","","acc_pointer_IR","optic_Aco",["30Rnd_762x39_Mag_F",30],[],""],[],["hgun_Rook40_F","muzzle_snds_L","","",["16Rnd_9x21_Mag",16],[],""],["U_C_Driver_1_black",[["FirstAidKit",1],["Chemlight_red",1,1],["30Rnd_762x39_Mag_F",1,30]]],["V_PlateCarrierSpec_blk",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],["B_FieldPack_oucamo",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],"H_PilotHelmetFighter_I","G_Balaclava_TI_blk_F",["Rangefinder","","","",[],[],""],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""]]],

 

 

Thank you for help guys ;)

Share this post


Link to post
Share on other sites
missionNamespace setVariable ["BAS_unitObject", (createGroup east) createUnit ["O_recon_F", thisTrigger, [], 0, "NONE"]];
(missionNamespace getVariable "BAS_unitObject") setUnitLoadout ["O_recon_F",[["arifle_AK12_F","","acc_pointer_IR","optic_Aco",["30Rnd_762x39_Mag_F",30],[],""],[],["hgun_Rook40_F","muzzle_snds_L","","",["16Rnd_9x21_Mag",16],[],""],["U_C_Driver_1_black",[["FirstAidKit",1],["Chemlight_red",1,1],["30Rnd_762x39_Mag_F",1,30]]],["V_PlateCarrierSpec_blk",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],["B_FieldPack_oucamo",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],"H_PilotHelmetFighter_I","G_Balaclava_TI_blk_F",["Rangefinder","","","",[],[],""],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""]]];

Use getUnitLoadout and setUnitLoadout to save and apply loadouts. Where did you actually get this loadout format from?

Commands: setUnitLoadout, getUnitLoadout

Error Message with your loadout: #setUnitLoadout | Error type string, expected Array

 

Share this post


Link to post
Share on other sites

Thank you for you help bro ;) i its this command :

 

copyToClipboard format ["[%1,%2],", str typeOf player, getUnitLoadout player];

 

 

  • Like 1

Share this post


Link to post
Share on other sites
_yourArray = ["O_recon_F",[["arifle_AK12_F","","acc_pointer_IR","optic_Aco",["30Rnd_762x39_Mag_F",30],[],""],[],["hgun_Rook40_F","muzzle_snds_L","","",["16Rnd_9x21_Mag",16],[],""],["U_C_Driver_1_black",[["FirstAidKit",1],["Chemlight_red",1,1],["30Rnd_762x39_Mag_F",1,30]]],["V_PlateCarrierSpec_blk",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],["B_FieldPack_oucamo",[["30Rnd_762x39_Mag_Tracer_F",4,30]]],"H_PilotHelmetFighter_I","G_Balaclava_TI_blk_F",["Rangefinder","","","",[],[],""],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""]]] ;

missionNamespace setVariable ["BAS_unitObject", (createGroup east) createUnit [_yourArray select 0, thisTrigger, [], 0, "NONE"]];
(missionNamespace getVariable "BAS_unitObject") setUnitLoadout (_yourArray select 1);

 

Btw, what is the added value,here, to use missionNameSpace setVariable ["BAS_UnitObject", <something> ] instead of BAS_UnitObject = <something>  ?

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×