Breaking Night Vision

Night missions without night vision goggles are a real pleasure in Arma 3. The only problem is that—much like the Australian Emu—players will jump onto any shiny thing they see, and keeping night vision away from them can prove difficult. Using night vision on AI units is also often necessary, since they often have difficulties on dark nights without it.

The following snippet breaks night vision for the local player by substantially darkening the screen when night vision mode is used. It can be switched off by executing:

fhcb_blindNightVisionGoggles = false;

And then switched on with:

fhcb_blindNightVisionGoggles = true;

Without further ado:

if (isDedicated) exitWith { };

fhcb_blindNightVisionGoggles = true;
 
[] spawn
{
    while { true } do
    {
        private "_nightVisionEffect";
 
        waitUntil { currentVisionMode player == 1 and fhcb_blindNightVisionGoggles };
 
        _nightVisionEffect = ppEffectCreate ["colorCorrections", 1501];
        _nightVisionEffect ppEffectEnable true;
        _nightVisionEffect ppEffectAdjust [0.05, 1.0, 0.0,
            [0.0, 0.0, 0.0, 0.0],
            [0.0, 1.0, 0.0, 1.0],
            [0.0, 0.0, 0.0, 0.0]];
        _nightVisionEffect ppEffectForceInNVG true;
        _nightVisionEffect ppEffectCommit 0;
 
        waitUntil { !(currentVisionMode player == 1 and fhcb_blindNightVisionGoggles) };
 
        ppEffectDestroy _nightVisionEffect;
    };
};