Announcement

Collapse
No announcement yet.

Better NightVision

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Better NightVision

    First off, to use this, every player cannot have NVGoggles as I overwrite the shortcut for them (plus they can use them + this script) so in each character do this:

    Code:
    this removeWeapon "NVGoggles";
    In you init.sqf do this:
    Code:
    waitUntil { !isNil {player} };
    waitUntil { player == player };
    player setVariable ["NV", ["OFF", 0.02]];
    player addAction ["Night Vision", "nightVision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
    and nightVision.sqf
    Code:
    _gen = _this select 0;
    _caller = _this select 1;
    _id = _this select 2;
    
    _gen removeAction _id;
    
    _NV = player getvariable "NV";
    _NVOn = (_NV select 0);
    _OldAperture = (_NV select 1);
    
    if(_NVOn == "ON") 
    exitwith
    {
    	setaperture -1;
    	ppEffectDestroy ppColor;
    	ppEffectDestroy ppBlur;
    	player setvariable ["NV",["OFF",_oldAperture]];
    	player addAction ["Night Vision", "nightVision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
    };
    
    ppEffectDestroy ppColor;
    ppEffectDestroy ppBlur;
    
    ppColor = ppEffectCreate ["ColorCorrections", 1999];  
    ppColor ppEffectEnable true;  
    ppColor ppEffectAdjust [1, 1, 0, [0.4, 1, 0.4, 0], [0.4, 1, 0.4, 0.0], [0.4, 1, 0.4, 1.0]];  
    ppColor ppEffectCommit 0;
    
    ppBlur = ppEffectCreate ["dynamicBlur", 505];
    ppBlur ppEffectEnable true;  
    ppBlur ppEffectAdjust [.2];
    ppBlur ppEffectCommit 0;
    
    aperture = 0.0001;
    while { aperture < _oldAperture } do
    {
    	aperture = aperture + 0.0005;
    	setAperture aperture;
    	sleep 0.001;
    };
    
    
    player setVariable ["NV", ["ON", _oldAperture]];
    
    player addAction ["Night Vision", "nightVision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
    exit;

    Lower the '0.02' value to make it brighter, raise it to make it darker
    Code:
    player setVariable ["NV", ["OFF", 0.02]];
    Lower the '.2' value to make it less blurry, raise it to make it blurrier
    Code:
    ppBlur ppEffectAdjust [.2];

    I am currently working on adding some key binds so players can manually adjust their aperture (the way it should be in game... not this auto adjusting crap that lowers the aperture to the point of making every a green nothingness if there is a light with 1km of you). After that, I'd like to actually add this to the NVGoggles.

    You can call this by simply press N or rolling the mouse wheel to Night Vision.
    ---Bellicosity---


  • #2
    Re: Better NightVision

    On a side note, want to do a night mission without NVGoggles?
    In init.sqf (AFTER THE PLAYER IS INITIALIZED) do
    Code:
    setAperture 0.35;
    BEFORE:


    AFTER:


    It will make it seem like a brighter night. Will still need flares for dark areas away from city but it wont be PITCH BLACK like it normally is. Put it at 0.1 or 0.2 and you wont even need NVGs. Can also use this to make a day really bright but you want the number much higher than 0.5. Can use the opposite to make a day really dark. Want a dark stormy day? Put the weather to crap and

    Code:
    setAperture 35;
    BEFORE:


    AFTER:
    ---Bellicosity---

    Comment


    • #3
      Re: Better NightVision

      Throw a test mission up, make yourself a rifleman somewhere and put this in your init line:
      Code:
      ppBlur = ppEffectCreate ["dynamicBlur", 505];  ppBlur ppEffectEnable true;    ppBlur ppEffectAdjust [1];  ppBlur ppEffectCommit 0;
      Makes the effect like you need glasses but have none.

      WARNING: MIGHT GIVE YOU A HEADACHE.
      ---Bellicosity---

      Comment


      • #4
        Re: Better NightVision

        I like the low aperture in daytime more than high aperture at night. Actually makes the clouds somewhat useful. On the flip side, if you want brighter nights, PLAY WITH A FULL MOON. : )

        Comment


        • #5
          Re: Better NightVision

          That looks like a good way to start "fixing" things. The same principle works for a pseudo-FLIR too, and I mean for vehicles that would realistically have it, not infantry:
          http://forums.bistudio.com/showthrea...t=79500&page=5

          Not to mention both of these can be modified to an addon-version with little work :)

          Comment


          • #6
            Re: Better NightVision

            Neat stuff with the aperture settings and post-processing.

            Can't agree on the night brightness though ... ever been outside when there is no moon? It are dark. Want it to not be so dark? Play at a time/date with a moon, or don't play in a thunderstorm at night and wonder why you can't see anything.

            Comment


            • #7
              Re: Better NightVision

              You and your black magic! I'll have you burned at the stake!
              Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity. - General George S. Patton.

              Comment


              • #8
                Re: Better NightVision

                Originally posted by Sc[ + ]pe View Post
                I like the low aperture in daytime more than high aperture at night. Actually makes the clouds somewhat useful. On the flip side, if you want brighter nights, PLAY WITH A FULL MOON. : )
                You got it backwards. High aperture in daytime and low aperture at night.

                Originally posted by beita View Post
                Neat stuff with the aperture settings and post-processing.

                Can't agree on the night brightness though ... ever been outside when there is no moon? It are dark. Want it to not be so dark? Play at a time/date with a moon, or don't play in a thunderstorm at night and wonder why you can't see anything.
                I live out in the country and even on a moonless clear night I can still see quite the distance by stars alone.
                ---Bellicosity---

                Comment


                • #9
                  Re: Better NightVision

                  Never thought of doing this before. Could make for some interesting effects (drugged captive) for missions.

                  Comment


                  • #10
                    Re: Better NightVision

                    Originally posted by dagi View Post
                    Never thought of doing this before. Could make for some interesting effects (drugged captive) for missions.
                    I was thinking that same thing too, though you might want the water blur effect for that.

                    Code:
                    "wetDistortion" ppEffectEnable true;
                    "wetDistortion" ppEffectAdjust [5];
                    "wetDistortion" ppEffectCommit 1; 
                    "dynamicBlur" ppEffectEnable true; 
                    "dynamicBlur" ppEffectAdjust [.3]; 
                    "dynamicBlur" ppEffectCommit 1;
                    Though if you throw in the color distortion for that player alone as well, you can get some really psychedelic drugs going on.

                    Code:
                    delay = 1; "colorInversion" ppEffectEnable true; "colorInversion" ppEffectAdjust [0,0,0]; "colorInversion" ppEffectCommit 0; sqf = [] spawn {while {true} do {sleep delay; "colorInversion" ppEffectAdjust [random 1,random 1,random 1]; "colorInversion" ppEffectCommit delay}}
                    Throw the above in a radio alpha call trigger... and um, prepare to see what its like to be on acid.
                    ---Bellicosity---

                    Comment


                    • #11
                      Re: Better NightVision

                      This is too funny... Putting this into a script that is called around smoke grenades... Makes a great tear gas effect as well.

                      Comment

                      Connect

                      Collapse

                      TeamSpeak 3 Server

                      Collapse

                      Advertisement

                      Collapse

                      Twitter Feed

                      Collapse

                      Working...
                      X