Jump to content
Sign in to follow this  
dylanplecki

Disable Night Vision Goggles for OpFor

Recommended Posts

Hey guys, I'm having a scripting issue. So I made a night-time Coop mission, nothing unusual, but to keep AI use to a minimum I decided to use triggers, markers, and the BIS_fnc_spawnGroup command to only spawn AI when a player is near their position.

This works perfectly, with enemy AI spawning when a player is within say 500m-800m from their "spawn marker", yet I have no way to customize the AI I spawn in other than choosing what group config is used. So now I have a lot of super-enemies with NVG's while our team has none (It's a low tech mission), so they can see us before we can see them.

So my question is: How do I keep OpFor from having NVG's? (It seems that it is out of the question to put this removeweapon "NVGoggles"; into the units init field because I have units spawning in using the BIS_fnc_spawnGroup command)

I've come up with a few solutions, but I do not know how to implement them:

- To create a reoccurring script with parameters that everyone that is opfor and carrying NVG's to use removeweapon "NVGoggles" (Could also be a trigger, though to me it seems that this could be very resource heavy on the server, idk)

- To add an argument to BIS_fnc_spawnGroup to remove NVG's

- Use an alternative function to spawn in AI that can customize the unit's init field

Also I need a code that will be MP proof, since I will use it as a Coop game. Thanks :)

Share this post


Link to post
Share on other sites

BIS_fnc_spawnGroup returns the group so something like

grp = [getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x removeWeapon "NVGoggles"}forEach units grp;

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  

×