Jump to content
Sign in to follow this  
wuffman

Custom backpack place into ammobox

Recommended Posts

Is there any reference to placing a custom loaded backpack into a box? I know how to place a backpack into any box, but cannot figure out how to put it in with custom gear inside. I want my player to pick up his backpack with a pistol, mags, and health already inside. Currently I am placing all these items into a custom box, but it takes too long to gather all items into backpack; I just want him to grab and go... It hasn't worked for me to assign within box, like you do a unit. Thanks in advance, and apologies if I am in the wrong place, or if this is common knowledge. I HAVE searched... Regards - wuffman

Please read thoroughly; not asking for "How to place backpack into box " . Thank You.

Edited by wuffman

Share this post


Link to post
Share on other sites

hmm, I know how to put something in a backpack:

for instance:

"B_Carryall_ocamo" addMagazinecargo ["RPG32_AA_F", 1];  

I know how to add a backpack inside an ammobox:

 _ammobox addBackpackCargoglobal ["B_Carryall_ocamo",2];

But I don't know how to add the backpack with the stuff in it, inside the ammobox...

The issue here is that the commands addBackpackCargoglobal, addweaponcargo ect. require classnames and you can't then

create a backpack in a script, put some stuff in it and then put it in the ammobox (at least with this method).

can't you just put it directly on the player back and put stuff in it using http://community.bistudio.com/wiki/unitBackpack?

Putting it on the ground near the ammo box doesn't work (you wouldn't be able to pick it up for the moment due to an alpha bug).

Share this post


Link to post
Share on other sites

Thank you for your reply. Yes, you are correct in the classname requirement; hence me asking this question in the first place. Part of the mission requires player to "pick up" backpack, not just appear with it already on. But again, thanks ... (?)

Share this post


Link to post
Share on other sites

Not an ideal solution but you can get the object returned for the first backpack in a crate then add what ever you want to it.

nil = [this] spawn {while {true} do {

_crate = _this select 0;
_crate addBackpackCargo ["B_Carryall_ocamo", 1];	//add backpack to crate
_bpack = firstBackpack _crate;							//get object for backpack
_bpack addMagazineCargo ["RPG32_AA_F", 1];			//place magazine in backpack

waitUntil {isNull (firstBackpack _crate)};			//wait until backpack is taken and insert another
};};

Place the above in a crate, weaponHolders init line. It will keep replacing the backpack with a newly filled one every time one is taken.

Just a shame backpackCargo does not return an array of backpack objects rather than names. Or even if we could fill backpacks like this in an wepaonHolder of map and have the ability to remove and insert by object name into another crate. Maybe the ability does exists but this is the only way ive found so far.

  • Like 1

Share this post


Link to post
Share on other sites

Thank You, Larrow. This is indeed a way to acomplish a custom loadout backpack in a crate; Nicely done!

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  

×