Jump to content
Sign in to follow this  
rtek

Help: Remove Night Vision from ALL OpFor on map

Recommended Posts

I know how to remove nightvision from single units and from all units. However, I can't get nightvision removed from A.I. that spawn at a site. The script below was posted in another thread. It works on all units that did not spawn from a site. So it doesn't help me much. Someone suggested putting in a delay so it can affect the delayed spawn of site A.I., however I have no idea how to that.

All I want, is to remove night vision from ALL OpFor on the entire map. A.I. I put down and the A.I. that spawn from Sites. I have the map completely populated with sites, and the opfor having nightvision ruins all night time gameplay, so I have to get rid of them.

Also, I've tried to put in the unassignitem and removeitem stuff into the site's init, but there's no room to put it all in. It's just one line and not a box like when you place down a soldier or vehicle. I hope they change this so we can just put in script into the site's init and have it actually work without having to mess with the init.sqf

Any help is much appreciated. Thanks in advance.

"Something like this on mission start via init.sqf

PHP Code:

{

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

You already asked this question. You don't need to make a new post about it. Especially since your answer was already in the post you quoted and included here.

Share this post


Link to post
Share on other sites

That script doesn't remove nvg's from a.i. that spawn at sites. So my question isn't answered.

Share this post


Link to post
Share on other sites

Just run that code after you've spawned whatever sites you wanted. If you're talking about sites placed on the map this works as an init.sqf:

sleep 1;

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

The sleep 1; line means "pause a second" and in init.sqf anything AFTER the sleep command happens once the game is loaded. So it'll load all the bad guys at the site, wait a second till the game starts then strip their NVGs.

Share this post


Link to post
Share on other sites

Thank you kylania. I had to bump the sleep time up to 15 to get it work, but it does work. Thanks again.

sleep 15;

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

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

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

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

Will this work to cover the entire map? I get an error saying undefined variable in expression: north south west. It works, but not sure what's up with the error.

Edited by RTEK

Share this post


Link to post
Share on other sites

The east doesn't refer to the map, but rather to the faction, there is no need for the west, north or south sections.

Share this post


Link to post
Share on other sites

Yeah, the "east" refers to the side of the units. Mosts sides you'll use include: "WEST", "EAST", "GUER", "CIV".

WEST is BLUFOR/BLUE/"US".

EAST is OPFOR/RED/"Iran"

GUER is INDEPENDENT/GREEN/"Greece"

CIV is Civilians

Share this post


Link to post
Share on other sites

Oh.....lol ok thanks.

Share this post


Link to post
Share on other sites

How could I get this in a loop?

I've tried this.. but doesn't work.

while {alive _x} do
{
{
   if(side _x == 2) then {
       _x unassignItem "NVGoggles";
       _x removeItem "NVGoggles";
						 };
} 
	foreach (allUnits);

	sleep 15;

} 

I'm using EOS script with indepent enemies, but they all have NVG's. I need to have those removed. but those units aren't spawned at the beginning of the map; they spawn once you get closer.

Share this post


Link to post
Share on other sites

Ideally you'd have some way of directly removing items from spawned enemies via EOS itself, but if not just change while {alive _x} to while {true} to constantly cycle or or just put that code into a function and simply call the function after you spawn new guys.

Share this post


Link to post
Share on other sites

Okey, thank you. What is the correct name for the independent side in arma 3? Configviewer only told me "side = 2" on indep soldiers

Share this post


Link to post
Share on other sites

Too funny.

The NV always bugged me. Pack those things away. They're expensive.

Everyone walking around looking like unicorns with that sticking out.

This will help alot thanks! Was tweaking each and every unit. You

know IF this does anything IN-GAME? Does the AI need these to

'actually' see at night or no? Doing secret night-ops and the AI seems

to find us way too easy. hmm...

Thinking of doing two Maps for everything I do. One Day & one Night.

Night one may reduce Units by 60% and lower spotDistance way down.

Share this post


Link to post
Share on other sites

still doesn't work..

while {true} do
{
{
   if(side _x == 2) then {
       _x unassignItem "NVGoggles";
       _x removeItem "NVGoggles";
						 };
	foreach (allUnits);

	sleep 15;
}	
} 

Share this post


Link to post
Share on other sites
still doesn't work..

That's because you used 2 for some reason instead of independent as I said to. :)

sleep 1;

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

Share this post


Link to post
Share on other sites

The name for opfor NVGOGGLES is = "NVGoggles_OPFOR"/////////// Independant is = "NVGoggles_INDEP"/////////// Hope this helps even though this is an old thread

Share this post


Link to post
Share on other sites

I know it's not the most polite thing to do, to dig up such an old thread, but I'm not finding any other solutions right now:

I want those NVGs gone for good. Problem is: Using sleeps does not work if the units are being spawned way, way later in the game (for example via Zeus).

Currently I'm just adding this to my init.sqf, but that does only work for units placed in the editor.

	{
	if (side _x == east) then 
	{
			_x unlinkItem "NVGoggles_OPFOR";
			_x removePrimaryWeaponItem "acc_pointer_IR";
			_x addPrimaryWeaponItem "acc_flashlight";
	};
}foreach allUnits;

I'd need a solution that removes NVGs constantly. As soon as a unit is being spawned, the NVGs have to go. But unfortunately I have no idea how to achieve that.

Share this post


Link to post
Share on other sites
I know it's not the most polite thing to do, to dig up such an old thread, but I'm not finding any other solutions right now:

I want those NVGs gone for good. Problem is: Using sleeps does not work if the units are being spawned way, way later in the game (for example via Zeus).

Currently I'm just adding this to my init.sqf, but that does only work for units placed in the editor.

	{
	if (side _x == east) then 
	{
			_x unlinkItem "NVGoggles_OPFOR";
			_x removePrimaryWeaponItem "acc_pointer_IR";
			_x addPrimaryWeaponItem "acc_flashlight";
	};
}foreach allUnits;

I'd need a solution that removes NVGs constantly. As soon as a unit is being spawned, the NVGs have to go. But unfortunately I have no idea how to achieve that.

Put it into a loop like the other guys did above.

    
while {true} do {
{ 
       if (side _x == east) then  
       { 
               _x unlinkItem "NVGoggles_OPFOR"; 
               _x removePrimaryWeaponItem "acc_pointer_IR"; 
               _x addPrimaryWeaponItem "acc_flashlight"; 
       }; 
   }foreach allUnits;

sleep 5;
};

Share this post


Link to post
Share on other sites
Put it into a loop like the other guys did above.

Tried it like that, but it didn't work... because I've had a stupid typo in my version. ;)

Thank you for clarifying!

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  

×