Jump to content
Sign in to follow this  
MrSanchez

How to add current weapon w/ attachments to a box?

Recommended Posts

As the title suggests, I have no idea atm..

 

I've got a weapon, a modded weapon, example: "hlc_rifle_g3a3ris" (it's a dynamic script, using currentWeapon to retrieve the current weapon), but the gun has attachments, in this scenario just: "optic_ACO_grn" how do I add this gun with the attachments on it to a box/holder?

I can not use the action drop weapon because it doesn't work while running and forces an unwanted animation.

 

Anyone have any ideas?

 

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

Try this, I am not on PC right now:

_cur = currentWeapon player;
_att = getWeaponCargo _cur;

crate addWeaponCargo [_cur, 1];
If ((getWeaponCargo crate) == _cur) then {

{ _x addPrimaryWeaponItem _att } forEach (getWeaponCargo crate) == _cur;
};
player removeWeapon _cur;
I have no idea if the code works, but have a fiddle with it until you solve your problem. :)

Share this post


Link to post
Share on other sites

I can tell that won't work but thanks though - atm there's an undocumented command in-game called Addweaponitem, I wonder if it works on containers... If not then we need a cargo variant such as the one suggested in killzones issue post

http://feedback.arma3.com/view.php?id=21469

http://feedback.arma3.com/view.php?id=20583

Share this post


Link to post
Share on other sites

-_- The developers have done the same thing you are after, I bet it's in the "ui_f.pbo". There is most likely a command in the community, or its something the devs have left out...

Again, my code is not official, but you'll know what I mean.

Share this post


Link to post
Share on other sites

I have also submitted a ticket for such a command. Still no word

 

In the meantime you'll have to use KK's workaround of spawning a CIV unit on top of the crate, adding the weapon and attachments to him, and making him drop the weapon into the crate. Do note that the civ is visible long enough so that somebody could see him, to also work around this you'll want to spawn the crate and civ somewhere far away from where you expect people to be, move the weapon in, then move the crate to it's final location.

Share this post


Link to post
Share on other sites

I'll mess around with that workaround, see if it's quick enough & consistent enough for what I aim to achieve. If not, guess I'll have to wait til 1.50 or 1.52 or perhaps 1.54 til this shit gets implemented.

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  

×