OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Rommel92 on 02 Dec 2009, 06:11:23

Title: RMM NVG - Adjustable Night Vision
Post by: Rommel92 on 02 Dec 2009, 06:11:23
(http://img513.imageshack.us/img513/4418/anv.th.png) (http://img513.imageshack.us/my.php?image=anv.png)
(Example of increasing NV sensitivity)

Description:
I always disliked the use of add-ons that were easily done in missions, and especially for servers that run without add-ons, the ability to do some things that just really bug me.
That is why I created a mission side adjustable night vision script, please note it requires the BIS functions module. As always, an example mission is provided.

This script allows the player to adjust the sensitivity of his/her night vision using the page up and page down keys, or pressing the end key to enable auto adjust (BIS default).


Contents (mission folder):
init.sqf
mission.sqm
RMM_Modules.sqf
scripts\init_keyDown.sqf
scripts\init_NV_Adjust.sqf
RMM_Core (http://forums.bistudio.com/showthread.php?t=91166)

Usage:

To disable or enable the adjustable night vision, simply comment or uncomment the lines as follows:

To enable:
Code: [Select]
// Sets onKeydown display (46) event handler, array RMM_OKD is created with the format [<keys>, <code>], requires BIS functions module
if (RMM_Client) then {"scripts\init_keyDown.sqf" call RMM_f_ExecVM};

// Enables adjustable night vision, requires RMM_OKD, requires BIS functions module
if (RMM_Client) then {"scripts\init_NV_Adjust.sqf" call RMM_f_ExecVM};

To disable:
Code: [Select]
// Sets onKeydown display (46) event handler, array RMM_OKD is created with the format [<keys>, <code>], requires BIS functions module
//if (RMM_Client) then {"scripts\init_keyDown.sqf" call RMM_f_ExecVM};

// Enables adjustable night vision, requires RMM_OKD, requires BIS functions module
//if (RMM_Client) then {"scripts\init_NV_Adjust.sqf" call RMM_f_ExecVM};

To adjust the settings of the Adjustable night vision, open up the script "scripts\init_NV_Adjust.sqf" and modify the following settings only:
Code: [Select]
#define BRIGHTEN 201 //Page Up
#define DARKEN 209 //Page Down
#define AUTOADJUST 207 //End
#define MAX_APERTURE 25
#define MIN_APERTURE 0.7

List of Key Codes (http://"http://community.bistudio.com/wiki/ListOfKeyCodes")

Dependencies:
RMM_Core Functions (http://"http://forums.bistudio.com/showthread.php?t=91166")
BIS Functions Module

Installation:
Simple installation; copy and paste the functions folder (and its contents) into your mission directory.
Ensure the BIS Functions module is placed in your mission.
Ensure RMM_Core is loaded correctly.

Compatibility Issues:
Some scripts may over-write the onKeyDown display event handler.

Author: Rommel
Date: 02/12/2009 (thats 12/02/2009 for the yanks)
Revision: 1

------------- DOWNLOAD -------------

Size: 4KB
Type: 7zip | .7z
Unpacker: www.7-zip.org (http://www.7-zip.org)

Mirrors:
http://www.4shared.com/file/163875435/1fa0696/RMM_NVGChernarus.html (http://www.4shared.com/file/163875435/1fa0696/RMM_NVGChernarus.html)