Page MenuHomeFeedback Tracker

Grenade/Smoke/Chemlight bugs with clear/add cargo to uniform/vest/backpack
Closed, ResolvedPublic

Description

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

Details

Legacy ID
44284025
Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Inventory
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..

Bug 1 seems to have been fixed, as I can't reproduce it.
However, bug 2 still persists unfortunately. It happens only if the player doesn't have the throwable class that's added with the command.

You need to start with an empty inventory every time you execute a piece of code from below:

Ok:
player addMagazine "HandGrenade"; // 1 grenade is added to the uniform and you can throw it

Ok:
player addMagazine ["HandGrenade", 1]; // 1 grenade is added to the uniform and you can throw it

Broken:
(uniformContainer player) addMagazineCargo ["HandGrenade", 1]; // 1 grenade is added to the uniform, but you can't throw it

Broken:
(uniformContainer player) addMagazineCargoGlobal ["HandGrenade", 1]; // 1 grenade is added to the uniform, but you can't throw it

Ok:

player addMagazine "HandGrenade";
(uniformContainer player) addMagazineCargo ["HandGrenade", 1]; // 2 grenades are added to the uniform and you can throw them both

Ok:
player addItem "HandGrenade"; // 1 grenade is added to the uniform and you can throw it

Ok:
player addItemToUniform "HandGrenade"; // 1 grenade is added to the uniform and you can throw it

Broken:
(uniformContainer player) addItemCargo ["HandGrenade", 1]; // 1 grenade is added to the uniform, but you can't throw it

Broken:
(uniformContainer player) addItemCargoGlobal ["HandGrenade", 1]; // 1 grenade is added to the uniform, but you can't throw it

By broken I mean the throwable doesn't show up in the throwables list in the top right corner when cycling through throwables. You need to drop it and pick it up again in order to get it to work.


TLDR remains the same as the original bug report:

adding throwable items to uniform/vest/backpack with addXXXCargo commands adds unusable items

dedmen updated the task description. (Show Details)May 2 2024, 2:59 PM
dedmen set Ref Ticket to AIII-56381.
dedmen edited Steps To Reproduce. (Show Details)
dedmen edited Additional Information. (Show Details)
dedmen set Operating System to Windows 7.
dedmen added a subscriber: dedmen.

Wow this ticket is so old that it forced me to edit the line endings in the text :D

dedmen added a comment.May 3 2024, 5:09 PM

This bug happened because the unit needs to be notified that their inventory contents have changed.
With the commands that get the unit as argument its easy, the unit is right there.
But the commands that get a container, first need to find which unit it belongs to, and there might not be any unit at all.

In the end, a very simple fix though

addMagazineCargo
addItemCargo

addMagazineCargoGlobal
addMagazineAmmoCargo
addItemCargoGlobal

These I didn't do
addBackpackCargo
addBackpackCargoGlobal

You could add a backpack filled with grenades into the players existing backpack, but as far as I can see the game will not try to use ammo out of that sub-backpack, so it wouldn't matter for this.

dedmen changed the task status from Assigned to Feedback.May 3 2024, 5:18 PM

Next profiling and dev branch

I'm looking forward to the next profiling branch!

I just remembered that there is a similar issue with removeMagazine: If you run player removeMagazine "HandGrenade" when the player has 2 grenades, it will remove 1 grenade but the remaining one becomes unusable.
removeItem(XXX) commands don't seem to cause this issue.

Currently, if you have 1 grenade in your vest and you run (vestContainer player) addMagazineCargo ["HandGrenade", -1], the grenade selector in the top right will say 0x, but you can still throw the grenade.
I'll test this again once the next profiling is out, as you might have fixed it with these changes.

mrzorn added a subscriber: mrzorn.May 4 2024, 10:42 PM
johnb43 added a comment.EditedMay 8 2024, 2:18 PM

I tested addMagazineCargo, addItemCargo and addMagazineAmmoCargo, all are fixed. Tyvm!


I just remembered that there is a similar issue with removeMagazine: If you run player removeMagazine "HandGrenade" when the player has 2 grenades, it will remove 1 grenade but the remaining one becomes unusable.
removeItem(XXX) commands don't seem to cause this issue.

Currently, if you have 1 grenade in your vest and you run (vestContainer player) addMagazineCargo ["HandGrenade", -1], the grenade selector in the top right will say 0x, but you can still throw the grenade.
I'll test this again once the next profiling is out, as you might have fixed it with these changes.

I've just retested these with the latest profiling branch (2.16.151806) and unfortunately these bugs still persist.

https://feedback.bistudio.com/T79813 is a report of the first bug.

Wulf closed this task as Resolved.May 16 2024, 2:52 PM
Wulf added a subscriber: Wulf.

Fixed in Dev build 2.17.151825.