Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1.  
  2. // Night Vision Script Made by BroDouYouEvenBro/Turboswaggg/Tripod27 (I use too many different names) with the help of Killzone Kid (his blog is awesome) and PabstMirror from the ArmaDev subreddit
  3.  
  4. // Just put this file in the libraries > documents > arma 3/ arma 3 - other profiles > profile you saved the mission on > missions/MPMissions (put it in the folder of every version of your mission you find to be safe)
  5.  
  6. // Then either add the words [] execVM "NVscript.sqf"; to your init.sqf file in that same mission that you put this file in or make an init.sqf file in that same mission that you put this file in (make a notepad.txt file then rename the file to init.sqf) and put the words [] execVM "NVscript.sqf"; in it and save
  7.  
  8. // This script does seem to slow down if other scripts are being used, sometimes delaying the effects for a noticeable amount of time depending on how big the other scripts you added to your mission are
  9.  
  10. // If you make any improvments to this script try to tell me! I know there are things you can improve since I just started scripting 4 days before I finished this and if you manage to make a better version I wanna use it
  11.  
  12.  
  13. if (isDedicated) exitWith {};
  14. if (player != player) then {waitUntil {player == player};};
  15.  
  16. // Figures out how zoomed in you are (KillzoneKid is Awesome)
  17. KK_fnc_getZoom = {
  18. (
  19. [0.5,0.5]
  20. distance
  21. worldToScreen
  22. positionCameraToWorld
  23. [0,1.05,1]
  24. ) * (
  25. getResolution
  26. select
  27. 5
  28. )
  29. };
  30.  
  31. while {true} do {
  32.  
  33. waitUntil {
  34. // Adds Effects When NV Enabled
  35. ((vehicle player) == player) && ((currentVisionMode player) == 1)};
  36. // Effects below. If you wanna know what this stuff means so you can change the effects, go to https://community.bistudio.com/wiki/Post_process_effects
  37. // Effect modifiers that change based on range like overall blur and film grain size are further down
  38. // Dynamic Blur
  39. ppBlur = ppEffectCreate ["dynamicBlur", 500];
  40. ppBlur ppEffectEnable true;
  41. 500 ppEffectForceInNVG true;
  42.  
  43. // Edge Blur
  44. ppRim = ppEffectCreate ["RadialBlur", 250];
  45. ppRim ppEffectEnable true;
  46. ppRim ppEffectAdjust [0.015, 0.015, 0.22, 0.3];
  47. ppRim ppEffectCommit 0;
  48. 501 ppEffectForceInNVG true;
  49.  
  50. // Color and Contrast
  51. ppColor = ppEffectCreate ["ColorCorrections", 1500]; ppColor ppEffectEnable true;
  52. ppColor ppEffectAdjust [0.6, 1.4, -0.02, [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 0, 0]];
  53. ppColor ppEffectCommit 0;
  54. ppColor ppEffectForceInNVG true;
  55.  
  56. // Film Grain
  57. ppFilm = ppEffectCreate ["FilmGrain", 0.005];
  58. ppFilm ppEffectEnable true;
  59. 0.005 ppEffectForceInNVG true;
  60.  
  61. waitUntil {
  62. // Scaling effects during Zooming
  63. _zoomintensity = (call kk_fnc_getZoom * 10) / 30;
  64.  
  65. ppBlur ppEffectAdjust [0.25 + (_zoomIntensity * 0.35)];
  66. ppBlur ppEffectCommit 0;
  67.  
  68. ppFilm ppEffectAdjust [0.75, 1, _zoomIntensity, 0.4, 0.2, false];
  69. ppFilm ppEffectCommit 0;
  70. //Removes Effects When NV Disabled
  71. ((vehicle player) != player) || ((currentVisionMode player) != 1)
  72. };
  73.  
  74. ppEffectDestroy ppBlur;
  75. ppEffectDestroy ppRim;
  76. ppEffectDestroy ppColor;
  77. ppEffectDestroy ppFilm;
  78. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement