Jump to content
Sign in to follow this  
Rossrox

How do you remove nightvision goggles from a unit

Recommended Posts

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.

This doesn't work?? I've put it into the Init field of a number of OpFor AI and all still have NVGs once on preview within Editor.

Share this post


Link to post
Share on other sites

As we said at the top of this very page and in several other threads across the forums, OPFOR NVGoggles are now called: "NVGoggles_OPFOR"

Share this post


Link to post
Share on other sites

I remember seeing a script that based on the time of day, would add/remove NV goggles. But for the life of me I can't find it. Searched past the last 100 pages too.

Anyone remember it?

Edited by Beerkan

Share this post


Link to post
Share on other sites

@Beerkan

Try this in init.sqf:

if (!(daytime > 4 && daytime < 19)) then {{[_x, 0.03] execVM "nvgoogle.sqf"} foreach allUnits};

Create a file called nvgoogle.sqf:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

> 4 < 19 you can change this in your mission.

Hope it works.Not testing it now.

Cheers

Share this post


Link to post
Share on other sites
@Beerkan

Try this in init.sqf:

if (!(daytime > 4 && daytime < 19)) then {{[_x, 0.03] execVM "nvgoogle.sqf"} foreach allUnits};

Create a file called nvgoogle.sqf:

this unassignItem "NVGoggles";
this removeItem "NVGoggles";

> 4 < 19 you can change this in your mission.

Hope it works.Not testing it now.

Cheers

Thanks Valery,

You've seeded an idea.

Create a 'while {alive player} do' condition where based on the time of day, it will add/remove the ng.

Also going to use the single command

this unlinkItem "NVGoggles_INDEP";

as suggested by Kaylina

Edited by Beerkan

Share this post


Link to post
Share on other sites

is this somehow also usable on goggles ? i hate all the troops (AND CIVILIANS) spawning with ESS tactical goggles etc..

Share this post


Link to post
Share on other sites

Put this in your unit's init: ;)

this unassignItem "NVGoggles";
this removeItem "NVGoggles";

NOTE: I know you've already have this code listed above, but it should work when you put it IN the Unit's INIT.

Share this post


Link to post
Share on other sites

Put this in your unit's initialization

Faction Civil & Blufor :

this unassignItem "NVGoggles";
this removeItem "NVGoggles";

Faction Opfor :

this unassignItem "NVGoggles_OPFOR";
this removeItem "NVGoggles_OPFOR";

Faction Independent :

this unassignItem "NVGoggles_INDEP";
this removeItem "NVGoggles"_INDEP;

For all units (ex: east), put this in your file init.sqf

{
if (side _x == east) then {

_x unassignItem "NVGoggles_OPFOR";
_x removeItem "NVGoggles_OPFOR";


};
} foreach allunits;

or simply

this unlinkItem "NVGoggles";
this unlinkItem "NVGoggles_OPFOR";
this unlinkItem "NVGoggles_INDEP";

Edited by JonyBIgood

Share this post


Link to post
Share on other sites

This code is not working at removing NVG from all OPFOR units

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

(nor is when I put in "NVGoggles_Opfor" )

I am using units from Middle East Conflict Mod (but they should still be considered Opfor , correct?)

Edited by TMP95

Share this post


Link to post
Share on other sites
This code is not working at removing NVG from all OPFOR units

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

(nor is when I put in NVGoggles_Opfor

Do you mean removing NVGs from all or any OPFOR units?

Share this post


Link to post
Share on other sites
Do you mean removing NVGs from all or any OPFOR units?

I would like to remove NVG for all Opfor (for missions I'm building). Or even if I can just do in unit specific would be fine (within a units INIT).

Share this post


Link to post
Share on other sites

Well, JonyBIGood gave the code for every unit above:

{
if (side _x == east) then {

_x unassignItem "NVGoggles_OPFOR";
_x removeItem "NVGoggles_OPFOR";


};
} foreach allunits;  

You could also use the one line command of:

{
if (side _x == east) then {

_x unlinkItem "NVGoggles_OPFOR";


};
} foreach allunits;  

As stated by Beerkan and Kaylina. Placing these codes in your init.sqf should solve your issue.

Share this post


Link to post
Share on other sites

On further review - This does appear to be related to Middle East Conflict units - As CSAT units DO have their NVG removed! Huh. Wonder how to remove off MEC units.

Share this post


Link to post
Share on other sites
On further review - This does appear to be related to Middle East Conflict units - As CSAT units DO have their NVG removed! Huh. Wonder how to remove off MEC units.

You will need to find the classname list from that mod and look for the NVGs that they use. (Usually found in the mod folder, in your A3 directory or PW6 directory respectively, as a pdf or txt file). That particular mod has a lot of required mods however and could be pulling the NVG class from anywhere.

Edited by JShock

Share this post


Link to post
Share on other sites

@Jshock. Thanks! That is it. I've asked on the MEC thread for some help on how to remove!

Share this post


Link to post
Share on other sites

Hrm... my guys still have NVG's... love to know why. I even cut and paste this in... has something changed ?

this unassignItem "NVGoggles"; this removeItem "NVGoggles";

Share this post


Link to post
Share on other sites
Hrm... my guys still have NVG's... love to know why. I even cut and paste this in... has something changed ?

this unassignItem "NVGoggles"; this removeItem "NVGoggles";

Me too... gonna go check the feedback tracker, this worked last week!

Confused myself there...

NVGoggles for BLUFOR

NVGoggles_OPFOR for OPFOR

NVGoggles_INDEP for IND

Edited by Tavish

Share this post


Link to post
Share on other sites
Me too... gonna go check the feedback tracker, this worked last week!

EDIT: After a bit of testing, this only works on blufor units. OPFOR and IND both still have NVGs on.

They do have different classnames for each NV goggle by side (don't ask me why...).

Blufor = "NVGoggles"

Opfor = "NVGoggles_OPFOR"

Independent = "NVGoggles_INDEP"

Share this post


Link to post
Share on other sites

Found that, thanks dude!

Also using your example on the wiki for making units do automatic weapons fire ;)

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  

×