Page MenuHomeFeedback Tracker

Grenade/Smoke/Chemlight bugs with clear/add cargo to uniform/vest/backpack
Assigned, WishlistPublic


The procedure below describes how to produce bugs with throwable items (hand grenade, smoke shell, chemlight) by using commands like "clearXXXCargo" and "addXXXCargo" to the uniform/vest/backpack (commands XXXContainer).

To summarize the bug :

  • clearing uniform/vest/backpack leaves "invisible" (in inventory) but usable items
  • adding throwable items to uniform/vest/backpack with addXXXCargo commands adds unusable items


Legacy ID
Steps To Reproduce

Preparation :

  • Open mission editor in SP
  • Put a unit (BLUFOR > NATO > Men > Rifleman)
  • Preview the mission

Bug 1 :

  • Check your inventory : you have 1 smoke white, 1 smoke green, 2 hand grenades, 2 green chemlights in your vest
  • Open the debug console and execute this code to clear the vest :

_container = vestContainer player;
clearItemCargo _container;
clearMagazineCargo _container;
clearWeaponCargo _container;
clearBackpackCargo _container;

  • Check your inventory : the vest is empty, and there is no throwable item in the uniform.
  • Type "Ctrl + G" to check the available thwrowable items : it displays "smoke white x0", "smoke green x0", "grenade x0", "green light x0".
  • Type "G" to throw items : you can throw 1 smoke white, 1 smoke green, 1 hand grenade, 1 green chemlight

Bug 2 :

  • Don't quit the mission preview
  • Now execute this line in the debug console :

(vestContainer player) addMagazineCargo ["HandGrenade", 1];

  • Check your inventory : the vest contains 1 hand grenade
  • Type "Ctrl + G" or "G" to use the hand grenade : the hand grenade is unusable.
  • The only way to use it, is to drop the grenade on the floor, and to take it again into the inventory.

NOTES about bugs 1 and 2 :
The bug is exactly the same if :

  • You replace addMagazineCargo by addItemCargo.
  • You add the suffix "Global" on each scripting commands.
  • You replace "HandGrenade" by "SmokeShell" or "Chemlight_green".
  • You replace vestContainer by uniformContainer or backpackContainer.

If you execute codes shown in "bug 1" and "bug 2", without throwing the "grenade x0" during "bug 1" procedure, then the added throwable item is usable without droping/taking on ground. But you can throw two grenades, while the inventory shows only one in the vest.

You can also reproduce the "bug 2" by replacing the "bug 1" procedure by this code :
removeVest player;
player addVest "V_PlateCarrier1_rgr";

Event Timeline

madbull edited Steps To Reproduce. (Show Details)Nov 6 2013, 10:36 AM
madbull edited Additional Information. (Show Details)
madbull set Category to Inventory.
madbull set Reproducibility to Always.
madbull set Severity to None.
madbull set Resolution to Open.
madbull set Legacy ID to 44284025.May 7 2016, 5:21 PM

Thanks for really nice and descriptive repro!! I've made some changes in magz loading mechanism because of a Multiplayer code, so a bug were made :-( Going to fix it immediately

Thanks for your nice and hard work on the inventory thematics ;)

well a lot of work have been made today.. to be continued ;-) but just for your information: _container = vestContainer player; --> "xxxContainer" command has been declared as a UNSAFE which means that it could leads to a strange behavior (just like it was described in your thread) because "naked" container entity has no information about soldier who is wearing that container. So problem with grenades is about a fact, that grenade has its own special rule which says that grenade magazine is loaded into Throw weapon but is still present in owner container like vest, etc.. so when you "hard" clear that container, game currently has no mechanism how to get that situation..

anyway.. I'm working on a proper solution how to use vest/uniformContainer and take no care about these thrash on a background

you guys are really killing me :-/

Make throw items equipable - all problems solved!

So before throwing nade you have to select it first. so when it appears in your hand it is out of container

Yep your idea is not bad, but has two big bottlenecks. When we will make a stand alone slot for grenades, we have to do it for each muzzle of weapon "Throw"(7xSmoke,1xHG,4xchemlight,1xIR) which is a problem, and the second one: we do not allow to throw any throwable items(HG,smoke,..) when soldier has no uniform or vest to store those items in. We can speculate that he can have at least one throwable item stored in his pants, but.. you know ;-)

But I already made a solution. Unfortunately I can't provide it to a public yet. I do not know if this is a public information or isn't, but anything which won't be finished until this friday, won't be published in this year at all. The next Dev version(next after friday's one) will be some when in a january

The 'AddItem' command doesn't register a unit has magazines like throwable items (HandGrenade,etc.). The magazine like grenades are unusable until you pickup a throwable item.

This causes you to need to drop the throwable item on the ground and pick it up again. This is a problem because adding magazines with 'AddItem' command prevents AI from using those magazines like HandGrenades.

Adding magazines with 'AddMagazine' doesn't have this problem, though 'AddItem' now has commands like 'AddItemToVest' and such to fine tune where items are placed.

@japapatramtara Sorry I have completely missed your reply.

About not allowing throwing items when no uniform. Even more so making player hand as single item container would allow for more flexibility. Basically if you are in your pants you should still be able to hold an item in your hand.

I could be dreaming here but this would open so many doors for future development. At the moment it feels like you are trying to fit increased demand for variety into the old system. Sometimes it works sometimes it gets ugly. So I truly do not know how far you are prepared to go, because sometimes a redesign of a feature could save lots of headache in the future.

Resolved according to last dev report

ArmA 3 v1.16, 2014-04-29 still not working...
Hopefully x additemToX seems to work as a workaround.
Getting bored of all that workarounds and broken stuff guys .

Lecks added a comment.Jun 5 2014, 8:23 AM

Still not fixed 2014-05-29. This same bug also causes problems with trying to set a player to a specific number of grenades. For example, the following outputs "Started with 0 HandGrenades after deleting them. Added 1 and ended up with 2." unless you remove the grenades manually from the inventory screen first, in which case you end up with 1 as you should:

{ if( (_x select 0) == "HandGrenade") then { player removeMagazine (_x select 0); } } forEach (magazinesAmmoFull player);
_previousCount = {(_x select 0) == "HandGrenade"} count (MagazinesAmmoFull player);
player addItemToBackpack "HandGrenade";
_newCount = {(_x select 0) == "HandGrenade"} count (MagazinesAmmoFull player);
hint format["Started with %1 HandGrenades after deleting them. Added 1 and ended up with %2.", _previousCount, _newCount];

The above can be pasted in the debug console. Unfortunately checking if you have too many grenades at the end and removing one isn't an option because then you can't throw them.

version 1.20.124746

So this was supposed to be fixed since 2013 !? Its still not fixed, bad show..