Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
2,861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 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. waitUntil {
  33.  
  34. // Adds Effects When NV Enabled
  35. ((vehicle player) == player) && ((currentVisionMode player) == 1)};
  36.  
  37. // 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
  38. // Effect modifiers that change based on range like overall blur and film grain size are further down
  39.  
  40. // Dynamic Blur
  41. ppBlur = ppEffectCreate ["dynamicBlur", 500];
  42. ppBlur ppEffectEnable true;
  43. 500 ppEffectForceInNVG true;
  44.  
  45.  
  46. // Edge Blur
  47. ppRim = ppEffectCreate ["RadialBlur", 250];
  48. ppRim ppEffectEnable true;
  49. ppRim ppEffectAdjust [0.015, 0.015, 0.22, 0.3];
  50. ppRim ppEffectCommit 0;
  51. 501 ppEffectForceInNVG true;
  52.  
  53.  
  54. // Color and Contrast
  55. ppColor = ppEffectCreate ["ColorCorrections", 1500]; ppColor ppEffectEnable true;
  56. ppColor ppEffectAdjust [0.6, 1.4, -0.02, [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 0, 0]];
  57. ppColor ppEffectCommit 0;
  58. ppColor ppEffectForceInNVG true;
  59.  
  60.  
  61. // Film Grain
  62. ppFilm = ppEffectCreate ["FilmGrain", 0.005];
  63. ppFilm ppEffectEnable true;
  64. 0.005 ppEffectForceInNVG true;
  65.  
  66. waitUntil {
  67. // Scaling effects during Zooming
  68.  
  69. _zoomintensity = (call kk_fnc_getZoom * 10) / 30;
  70.  
  71.  
  72. ppBlur ppEffectAdjust [0.25 + (_zoomIntensity * 0.35)];
  73. ppBlur ppEffectCommit 0;
  74.  
  75.  
  76. ppFilm ppEffectAdjust [0.35, 1, _zoomIntensity, 0.4, 0.2, false];
  77. ppFilm ppEffectCommit 0;
  78.  
  79. //Removes Effects When NV Disabled
  80. ((vehicle player) != player) || ((currentVisionMode player) != 1)
  81. };
  82.  
  83. ppEffectDestroy ppBlur;
  84. ppEffectDestroy ppRim;
  85. ppEffectDestroy ppColor;
  86. ppEffectDestroy ppFilm;
  87. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement