Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. // 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
  2.  
  3. // 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)
  4.  
  5. // 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
  6.  
  7. // 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
  8.  
  9. // 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
  10.  
  11.  
  12. if (isDedicated) exitWith {};
  13. if (player != player) then {waitUntil {player == player};};
  14.  
  15. // Figures out how zoomed in you are (KillzoneKid is Awesome)
  16. KK_fnc_getZoom = {
  17. (
  18. [0.5,0.5]
  19. distance
  20. worldToScreen
  21. positionCameraToWorld
  22. [0,1.05,1]
  23. ) * (
  24. getResolution
  25. select
  26. 5
  27. )
  28. };
  29.  
  30. while {true} do {
  31. waitUntil {
  32. // Adds Effects When NV Enabled
  33. ((vehicle player) == player) && ((currentVisionMode player) == 1)};
  34. // 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
  35. // Effect modifiers that change based on range like overall blur and film grain size are further down
  36. // Dynamic Blur
  37. ppBlur = ppEffectCreate ["dynamicBlur", 500];
  38. ppBlur ppEffectEnable true;
  39. 500 ppEffectForceInNVG true;
  40.  
  41. // Edge Blur
  42. ppRim = ppEffectCreate ["RadialBlur", 250];
  43. ppRim ppEffectEnable true;
  44. ppRim ppEffectAdjust [0.015, 0.015, 0.22, 0.3];
  45. ppRim ppEffectCommit 0;
  46. 501 ppEffectForceInNVG true;
  47.  
  48. // Color and Contrast
  49. ppColor = ppEffectCreate ["ColorCorrections", 1500]; ppColor ppEffectEnable true;
  50. ppColor ppEffectAdjust [0.6, 1.4, -0.02, [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 0, 0]];
  51. ppColor ppEffectCommit 0;
  52. ppColor ppEffectForceInNVG true;
  53.  
  54. // Film Grain
  55. ppFilm = ppEffectCreate ["FilmGrain", 0.005];
  56. ppFilm ppEffectEnable true;
  57. 0.005 ppEffectForceInNVG true;
  58.  
  59. waitUntil {
  60. // Scaling effects during Zooming
  61.  
  62. _zoomintensity = (call kk_fnc_getZoom * 10) / 30;
  63.  
  64. ppBlur ppEffectAdjust [0.25 + (_zoomIntensity * 0.35)];
  65. ppBlur ppEffectCommit 0;
  66.  
  67. ppFilm ppEffectAdjust [0.35, 1, _zoomIntensity, 0.4, 0.2, false]; //--- 0.35 < adjust value
  68. ppFilm ppEffectCommit 0;
  69. //Removes Effects When NV Disabled
  70. ((vehicle player) != player) || ((currentVisionMode player) != 1)
  71. };
  72.  
  73. ppEffectDestroy ppBlur;
  74. ppEffectDestroy ppRim;
  75. ppEffectDestroy ppColor;
  76. ppEffectDestroy ppFilm;
  77. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement