Page MenuHomeFeedback Tracker

Adding NVGs using addWeapon lets you use them, but does not add the item
Closed, ResolvedPublic

Description

Using the old command for adding Night Vision Goggles to units (this addWeapon "NVGoggles";) does not give the unit the goggle item into inventory or on the model, but lets the unit use the goggles anyway.

Details

Legacy ID
1100601903
Severity
Minor
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Open editor
  2. Place down civilian player
  3. Type "this addWeapon "NVGoggles";" into the init field
  4. Preview the mission
  5. Turn on your night vision goggles
  6. Observe as your screen turns all night-visiony
  7. Open your inventory
  8. Observe your inventory not containing the goggles
Additional Information

This also works on actual soldiers, not just civilian units. Using a civilian unit is just handy for demonstration purposes, as you don't need to remove any items from it.

Event Timeline

Sniper_Party edited Additional Information. (Show Details)
Sniper_Party set Category to Scripting.
Sniper_Party set Reproducibility to Always.
Sniper_Party set Severity to Minor.
Sniper_Party set Resolution to Fixed.
Sniper_Party set Legacy ID to 1100601903.May 7 2016, 12:37 PM
Bohemia added a subscriber: Jukk.Mar 14 2013, 9:50 PM

Actually the NVG probably sit in the binocular slot. But since they have no icon for clients, you don't see it.

What qwasder said. NVG are now considered "Items", you need to use addItem. If you add NVG as Weapon, they will appear without an icon.

it doesn't make sense to have binoc's added with addWeapon, either. They should both just be assignable items.

@SaMatra: Yes, I know you're supposed to use addItem, which is why I described the addWeapon command as "old"; it is the one the previous games used. Regardless of whether you're supposed to use the addWeapon command, however, it doesn't seem like being able to add invisible but useable NVGs would be an intended feature.

It is a minor issue (and I probably should've put severity as trivial), but it is a bug and I thought I'd report it.

Hanz added a subscriber: Hanz.May 7 2016, 12:37 PM
Hanz added a comment.Apr 30 2013, 10:50 AM

This issue was processed by our team and will be looked into. We thank you for your feedback.

i understand your issue but I believe this is the correct way to do it

Code:

_unit addItem "NVGoggles";
_unit assignItem "NVGoggles";

this adds the image to your gear so u can see u have NV available and it also will work as intended

if you want binoculars use this

_unit addweapon "Binocular";

Note: this method i only tested on the current beta

@falconx1:

I'm aware of the correct way to do it, which is why I described the addWeapon-method as old (it was used for NVGs in the previous games). I reported this because, even if the command should not be used, the way it functions is clearly not intentional.

You would know this if you read the previous comments, where someone already told me to use addItem and I responded with almost this exact same message.

I report the same issue. addItem "NVGOGGLES" don't work.

workaround: Adding a backpack fixes the additem nvgoogles.

@djotacon if you dont have space in inventory it won't add nvgoggles. additem adds it to inventory. if you want to add it to the nvg slot you have to link them:

player linkItem "NVGoggles"

I cannot reproduce the problem stated in this ticket.

player addWeapon "NVGoggles"

adds NVGoggles makes them visible and makes them usable.

Same here. Unable to reproduce in current dev build, probably fixed with some other bug. Marking as resolved.

Mass-closing resolved issues updated only last year - assuming fixed correctly.

Cheers!