Welcome to Tactical Gamer

+ Reply to Thread
Results 1 to 11 of 11
Discussion: ArmA - Development / ArmA - Mission Development - Better NightVision - First off, to use this, every player cannot have NVGoggles as I overwrite the shortcut
  1. #1


    Join Date
    Jun 2007
    Posts
    351

    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.  
  3. #2


    Join Date
    Jun 2007
    Posts
    351

    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---


  4.  
  5. #3


    Join Date
    Jun 2007
    Posts
    351

    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---


  6.  

     
  7. #4

    Sc[ + ]pe's Avatar

    Join Date
    Aug 2007
    Location
    Vancouver, Canada
    Posts
    847

    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. : )

  8.  
  9. #5

    Fincuan's Avatar

    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    772

    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

  10.  
  11. #6


    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    737

    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.

  12.  

     
  13. #7

    GeneralCarver's Avatar

    Join Date
    Aug 2007
    Location
    Indiana, USA
    Age
    32
    Posts
    532

    Re: Better NightVision

    You and your black magic! I'll have you burned at the stake!

  14.  
  15. #8


    Join Date
    Jun 2007
    Posts
    351

    Re: Better NightVision

    Quote 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.

    Quote 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---


  16.  
  17. #9

    dagi's Avatar

    Join Date
    Jun 2009
    Posts
    18

    Re: Better NightVision

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

  18.  

     
  19. #10


    Join Date
    Jun 2007
    Posts
    351

    Re: Better NightVision

    Quote 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---


  20.  
  21. #11

    dagi's Avatar

    Join Date
    Jun 2009
    Posts
    18

    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.

  22.  

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


  
 

Back to top