-
07-28-2009, 04:03 AM #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:
In you init.sqf do this:Code:this removeWeapon "NVGoggles";
and nightVision.sqfCode:waitUntil { !isNil {player} }; waitUntil { player == player }; player setVariable ["NV", ["OFF", 0.02]]; player addAction ["Night Vision", "nightVision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
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
Lower the '.2' value to make it less blurry, raise it to make it blurrierCode:player setVariable ["NV", ["OFF", 0.02]];
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---

-
07-28-2009, 04:19 AM #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
BEFORE:Code:setAperture 0.35;

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
BEFORE:Code:setAperture 35;

AFTER:
---Bellicosity---

-
07-28-2009, 04:29 AM #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:
Makes the effect like you need glasses but have none.Code:ppBlur = ppEffectCreate ["dynamicBlur", 505]; ppBlur ppEffectEnable true; ppBlur ppEffectAdjust [1]; ppBlur ppEffectCommit 0;
WARNING: MIGHT GIVE YOU A HEADACHE.---Bellicosity---

-
07-28-2009, 05:03 AM #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. : )
-
07-28-2009, 06:11 AM #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
-
07-28-2009, 07:54 AM #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.
-
07-28-2009, 06:20 PM #7
Re: Better NightVision
You and your black magic! I'll have you burned at the stake!
-
07-28-2009, 07:26 PM #8
- Join Date
- Jun 2007
- Posts
- 351
-
07-28-2009, 07:55 PM #9
Re: Better NightVision
Never thought of doing this before. Could make for some interesting effects (drugged captive) for missions.
-
07-28-2009, 08:06 PM #10
- Join Date
- Jun 2007
- Posts
- 351
Re: Better NightVision
I was thinking that same thing too, though you might want the water blur effect for that.
Though if you throw in the color distortion for that player alone as well, you can get some really psychedelic drugs going on.Code:"wetDistortion" ppEffectEnable true; "wetDistortion" ppEffectAdjust [5]; "wetDistortion" ppEffectCommit 1; "dynamicBlur" ppEffectEnable true; "dynamicBlur" ppEffectAdjust [.3]; "dynamicBlur" ppEffectCommit 1;
Throw the above in a radio alpha call trigger... and um, prepare to see what its like to be on acid.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}}---Bellicosity---

-
07-29-2009, 12:16 PM #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.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



Reply With Quote


Bookmarks