Jump to content
OrnateCocoapuff

Adding items to a units backpack

Recommended Posts

Hello,

So I am trying to add a weapon and some ammunition to a unit's backpack, and I'm not sure what the script for that would be. Any help is appreciated,

Thanks.

Share this post


Link to post
Share on other sites
this addBackpack "B_AssaultPack_blk"; 
(unitBackpack this) addWeaponCargoGlobal ["arifle_TRG21_MRCO_F", 1]; 
(unitBackpack this) addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 4];

Share this post


Link to post
Share on other sites

Yup, you need to feed it an array like I did, not just the weapon name. If you want to add a single rifle it's:

(unitBackpack this) addWeaponCargoGlobal [color="#FF0000"][[/color]"arifle_TRG21_MRCO_F"[color="#FF0000"], 1][/color];

Share this post


Link to post
Share on other sites
Yup, you need to feed it an array like I did, not just the weapon name. If you want to add a single rifle it's:

(unitBackpack this) addWeaponCargoGlobal [color="#FF0000"][[/color]"arifle_TRG21_MRCO_F"[color="#FF0000"], 1][/color];

Hi kylania

work fine for me in the init but I have a problem with my SQF respawn, the Backpack is empty when respawn. Can you help me please.

thanks.

I have this in the init:

null = [this] execVM "loadout1.sqf";

this addeventhandler ["respawn","_this execVM 'loadout1.sqf'"];

and this is the sqf:

//_loadout1.sqf

waitUntil {!isNull player};

_unit = _this select 0;

//_Remove Items

removeallassigneditems _unit;

removeallcontainers _unit;

removeallweapons _unit;

//_Gear

_unit addBackPack "B_Kitbag_mcamo"; (unitBackpack this) addMagazineCargoGlobal ["AV_200Rnd_556x45", 4]; (unitBackpack this) additemCargoGlobal ["optic_MRCO", 1]; (unitBackpack this) addWeaponCargoGlobal ["av_m249_mrco", 1];

_unit addUniform "AV_CombatUniform1_OCP";

_unit addvest "AV_PlateCarrier2_OCP";

_unit addheadgear "H_Booniehat_mcam";

_unit addGoggles "shemagh_neckD";

//_Items

_unit addweapon "itemcompass";

_unit addweapon "itemmap";

_unit addweapon "itemwatch";

//_Weapons

_unit addweapon "RHARD_M4DDRPD_F";

_unit addweapon "hgun_P07_snds_F";

_unit addPrimaryWeaponItem "Muzzle_MK18D_L";

_unit addPrimaryWeaponItem "optic_Arco";

_unit addPrimaryWeaponItem "PEQ15_A3_Top";

_unit addmagazines ["30Rnd_556x45_Stanag", 10];

_unit addmagazines ["16Rnd_9x21_Mag", 3];

if(true) exitWith{};

Edited by Thor632

Share this post


Link to post
Share on other sites

Change (unitBackpack this) to (unitBackpack _unit)

You can also remove that last if true exit with line. That does nothing in SQF.

Share this post


Link to post
Share on other sites
Change (unitBackpack this) to (unitBackpack _unit)

You can also remove that last if true exit with line. That does nothing in SQF.

Perfect!!!!! you are my hero :292:

Thank you so much kylania.

Share this post


Link to post
Share on other sites

hello,

I need to add backpack like this one "O_UAV_01_backpack_F"  but to be Empty! I don't need UAV functionality just a model of that bag with loadable space for other thing like every other backpack. Is it possible ? Thank you 

Share this post


Link to post
Share on other sites

Thank you M1ke but maybe i am not good  explain what i want. I need bag to look like (just look like) to UAVbag ( "O_UAV_01_backpack_F" ) but without functionality of that. Just need to be empty bag with loadable space so i can put other things like in every other backpack via command addItemToBackpack. Sorry on my English and thank you sir.

 

I tried to search in classnames to find that bag by picture and hope to add it empty model but can't find.. Also tried to find by name but only i can find with UAV functionality

Share this post


Link to post
Share on other sites

Why mess with all the simple code in the unit init just go into the new Editor what you want the unit to have very simple no code point to click. 

Share this post


Link to post
Share on other sites

I don't understand. It can't be done in editor/arsenal or what else. It has to be scripted some way 

Share this post


Link to post
Share on other sites

No, you have to build an addon that creates a new object with the model and texture of the uav backpack. There's no way to have a new backpack in the game by scripting.

Share this post


Link to post
Share on other sites

So i can't kick out UAV  functionality and have clean empty bag? Okay, thank you for answer guys, so what am I to do? Ask someone to make addon? At least, maybe this thread can help someone and save his time. 

Share this post


Link to post
Share on other sites
39 minutes ago, Petifer said:

... so what am I to do? Ask someone to make addon? At least, maybe this thread can help someone and save his time. 

 

Use a different backpack.

Anyone of the "backpacks" shown on this page, Arma 3 Items list  (excluding the UAV, Mortar & Static machine guns)

 

One of the "Carryall" class should big enough for you.

Share this post


Link to post
Share on other sites

Yes yes, i already using carryall and bergain but model of UAVbag is just perfect what i need for spec units...  ..model size, colour camuflage etc.. 

Btw, i use this script simple paraDrop and thank you for it :D

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

×