Page MenuHomeFeedback Tracker

Item and Weapon commands are interchangable and cause issues when being used in combination.
Reviewed, NormalPublic

Description

Commands weapons still work on items and can lead to situations where the results are undefined.

If you use addWeaponCargo to add weapons that extend ItemCore (aka Items now I guess) removeItem and removeWeapon will fail to remove that item from your gear.

Details

Legacy ID
71721442
Severity
Major
Resolution
Open
Reproducibility
Have Not Tried
Category
Inventory
Steps To Reproduce
  1. Add a ammo crate and initialize with: "this addWeaponCargo ["FirstAidKit", 20];"
  2. Go into game and drop all your gear (at least the first aid kit).
  3. Go to crate, drag a first aid kit to your uniform.
  4. Go to debug menu, and execute 'player removeItem "FirstAidKit";'
  5. Check your gear, the first aid kit added is still there.
  6. Go back to debug menu and execute 'player removeWeapon "FirstAidKit";'
  7. Check your gear again, first aid kit is still there.
  8. Return once again to debug console and execute 'removeAllItems player';

The item is now removed.

Additional Information

It seems confusing that internally Weapons and Items are now different, but their config entries are still under CfgWeapons and their SQF interaction has no warning or error system to define when you are doing something incorrectly. This makes mission making/addon making confusing if you are not sure what Weapons/Items are descending from.

I am not sure what the fix for this is, but it seems like an issue that will make development for new community members significantly more complicated.

The only thing I can suggest is moving Items out of CfgWeapons and into their own Cfg* parent, like CfgItems. Making script commands differentiate between config hierarchies would also be very helpful as well.

Event Timeline

Nou edited Steps To Reproduce. (Show Details)Mar 14 2013, 8:24 AM
Nou edited Additional Information. (Show Details)
Nou set Category to Inventory.
Nou set Reproducibility to Have Not Tried.
Nou set Severity to Major.
Nou set Resolution to Open.
Nou set Legacy ID to 71721442.May 7 2016, 12:34 PM