Jump to content
Sign in to follow this  
niktator

Spawn loadout

Recommended Posts

Hi,

in the editor, I defined the loadout like this:

removeAllWeapons this;
this additem "NVGoggles";
this addWeapon "arifle_Khaybar_ARCO_point_F";  
this addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
this addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
this addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";  
this addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
this addWeapon "hgun_P07_snds_F";
this addMagazine "16Rnd_9x21_Mag";
this addMagazine "16Rnd_9x21_Mag";
this addMagazine "16Rnd_9x21_Mag";
this additem "firstaidkit";  
this addmagazine "Handgrenade";
this addmagazine "Handgrenade";

This works great - but if a player dies, this code is not parsed. He`s starting with default loadout. How can I get units respawned with the initial loadout?

greets, Nik

Share this post


Link to post
Share on other sites

You need to put that into file, and exec the file everytime the unit respawns. Here

So for you it would be:

loadout.sqf

_target = _this select 0;
removeAllWeapons _target;
_target additem "NVGoggles";
_target addWeapon "arifle_Khaybar_ARCO_point_F";  
_target addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
_target addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
_target addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";  
_target addMagazine "30Rnd_65x39_caseless_green_mag_Tracer";
_target addWeapon "hgun_P07_snds_F";
_target addMagazine "16Rnd_9x21_Mag";
_target addMagazine "16Rnd_9x21_Mag";
_target addMagazine "16Rnd_9x21_Mag";
_target additem "firstaidkit";  
_target addmagazine "Handgrenade";
_target addmagazine "Handgrenade";

and in unit's init

0 = [this] execVM 'loadout.sqf'; 
this addeventhandler ["respawn","0 = _this execVM 'loadout.sqf'"];  

Edited by aeroson

Share this post


Link to post
Share on other sites

quick addition...

I would like to remove the PRC-343 and add a PRC-148UHF.

The adding part I can do but it seems the 343 is not a weapon or an item. (removedallweapons this; and removeallitems this;) does not remove it.

What can I add right under removeAllWeapons target; in this script to accomplish this?

Share this post


Link to post
Share on other sites

classname is "ACRE_PRC148_UHF"

this addWEAPONcargo "acre_prc148_uhf"

I think this is correct usage?

Share this post


Link to post
Share on other sites

Thanks Fully. Here is what happened...

I add the above to the script and it deletes the 343 and does not put in the 148 in the same spot, it does not add the 148 at all.

So it's close, halfway there ;)

I am not sure what the spots are called for the map, compass, radio. I may have to remove all of them, and add them back with the right pieces in the script.

*edit*

I got it working by trial and error:

_target removeweapon "ItemRadio";

_target addweapon "acre_prc148_uhf";

added to bottom of script.

Edited by fasterthanlight

Share this post


Link to post
Share on other sites

Thanks for the help aeroson.

Yours is the only post I've found that gets it working in ArmA 3.

One question though;

The player respawns with all the gear, but how do I refill the backpack and vest?

That is, I use (unitBackpack this) addmagazineCargo ["DemoCharge_Remote_Mag",2]; to pack the unit normally.

What would be the syntax for repacking the backpack?

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
Sign in to follow this  

×