Jump to content
Sign in to follow this  
Rossrox

How do you remove nightvision goggles from a unit

Recommended Posts

Okay, so really enjoying the alpha, doing some mission editing, but I cannot remove the night vision goggles from the OpFor units.

I placed this removeweapon "NVGoggles"; in the init sections of the units, but it does not work, I can only assumed that its not a weapon anymore, or the classname has changed.

What am I doing wrong!?:mad:

Share this post


Link to post
Share on other sites

Placing removeHeadgear unit; in an OpFors init?

Does not work, on its own at least.

Do I need to change the unit variable?

Share this post


Link to post
Share on other sites

To remove NVG's for a unit via editor you put in their init field:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

You must first unassign an item that is in use by the unit before you can remove it.

Share this post


Link to post
Share on other sites
To remove NVG's for a unit via editor you put in their init field:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

You must first unassign an item that is in use by the unit before you can remove it.

You absolute legend. :yay:

Share this post


Link to post
Share on other sites

Great find! Thanks Tonic. I tried using the removeGoggles script but that didn't work at all.

Share this post


Link to post
Share on other sites

On a similar note: How to remove optics!

this unassignitem "optic_Arco"; this removeweapon "optic_Arco" does not work

Share this post


Link to post
Share on other sites
On a similar note: How to remove optics!

this unassignitem "optic_Arco"; this removeweapon "optic_Arco" does not work

The optic's are not considered as a weapon, they are a item. All attachments, clothing, headgear, backpacks, vests are all items. If you wanted to remove the attachments / optics you use the following format:

    this removeItemFromPrimaryWeapon "optic_acro";

Share this post


Link to post
Share on other sites

Ah, was struggling with this for awhile now, thanks Tonic :)

Share this post


Link to post
Share on other sites

guys i make 1 mission and i want to play in the night without nv googles and in my waepon flashlight so i add in all players init this unassignItem "NVGoggles"; this addPrimaryWeaponItem "acc_flashlight"; and work good but if i die and i make respawn the waepon return to deafault and i have again nv and no flashlight :( so what i need to do anyone can help here??? this probelm is in arma 3

Share this post


Link to post
Share on other sites
The optic's are not considered as a weapon, they are a item. All attachments, clothing, headgear, backpacks, vests are all items. If you wanted to remove the attachments / optics you use the following format:

    this removeItemFromPrimaryWeapon "optic_acro";

What about adding the Item? addItemForPrimaryWeapon?

EDIT: Found it. addPrimaryWeaponItem

Edited by HKFlash

Share this post


Link to post
Share on other sites

I went through each individual opfor soldier i put down and put in the script. How do I remove nvg's from soldier put down in a Site? You know, the ones we can't see in the editor but spawn in because there's a site there. I tried to put in the init but there's not enough space for the whole script.

Share this post


Link to post
Share on other sites
I went through each individual opfor soldier i put down and put in the script. How do I remove nvg's from soldier put down in a Site? You know, the ones we can't see in the editor but spawn in because there's a site there. I tried to put in the init but there's not enough space for the whole script.

Something like this on mission start via init.sqf

{
if(side _x == east) then
{
	_x unassignItem "NVGoggles";
	_x removeItem "NVGoggles";
};
} foreach (allUnits);

Change east to whatever side it is.

Share this post


Link to post
Share on other sites

If they are spawned from a site, add a small sleep for a second or two otherwise it might become a issue where the code is run before the units are spawned in.

Share this post


Link to post
Share on other sites

I'll try that.

How do I add a small sleep? Not sure I follow what you mean.

---------- Post added at 00:19 ---------- Previous post was at 00:05 ----------

Something like this on mission start via init.sqf

{
if(side _x == east) then
{
	_x unassignItem "NVGoggles";
	_x removeItem "NVGoggles";
};
} foreach (allUnits);

Change east to whatever side it is.

What do I put if I want to remove nightvision from all opfor on the entire map? Do I have to put this script 5 times for N, E, S, W, and Center?

I've copy/pasted this into my init.sqf and went in to see, but it doesn't work. It did however, remove the nightvision from my character I was using to move around, but all the A.I. from the site had their night vision. I just want to assign this removing of nvgoggles to the sites. There has to be a way.

I wish it was as easy as putting in Remove all nightvision from all opfor; and it actually work.

Edited by RTEK

Share this post


Link to post
Share on other sites

That code you quoted does exactly that, removes all the NVGoggles from all east units on the map. Note that "east" refers to OPFOR/Red/TheBadGuys and not "units on the east side of the map".

Make sure your init.sqf isn't

which might explain why it wasn't working for you.

Share this post


Link to post
Share on other sites
To remove NVG's for a unit via editor you put in their init field:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

You must first unassign an item that is in use by the unit before you can remove it.

I tried this but it won´t work. I´m on Dev Build.

http://i.imgur.com/0FDwraL.jpg (167 kB)

Edit: i found it, turns out you need to specify the fact that you are an independent......brilliant stuff..

Here is the code for Independents removing NV Goggles.

this unassignItem "NVGoggles_INDEP";

this removeItem "NVGoggles_INDEP";

Edited by RushHour

Share this post


Link to post
Share on other sites

You can now use this:

this unlinkItem "NVGoggles_INDEP";

To unassign and remove at the same time.

Share this post


Link to post
Share on other sites
...and now OPFOR is: "NVGoggles_OPFOR";

Thank you for the trick , adding OPFOR ............

But regarding BLUE this is not needed, correct?

Share this post


Link to post
Share on other sites
To remove NVG's for a unit via editor you put in their init field:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

You must first unassign an item that is in use by the unit before you can remove it.

Thank you for this! - Also, if I put this into the Group leaders init field (will it remove NVGs from all men within his unit? or do I need to do it for each individual man?) Thanks again

Share this post


Link to post
Share on other sites
Something like this on mission start via init.sqf

{
if(side _x == east) then
{
	_x unassignItem "NVGoggles";
	_x removeItem "NVGoggles";
};
} foreach (allUnits);

Change east to whatever side it is.

Excellent - So this is the quickest way to set all OpFor units to having no NVG. Thank you!

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  

×