Jump to content
Sign in to follow this  
sholio

Fixed Range Nightvision

Recommended Posts

Fixed Range Nightvision v0.7

The default high dynamic range while using nightvision in the game is somewhat faulty.

Most of the time you can use it fine, but in some cases it becomes almost unusable.

A light source in view makes the entire screen black or draws a contrast that makes gameplay impossible.

This addon allows disabling the stock hdr engine in nightvision and allows manual adjustment of NVG exposure.

So as promised, this is essentially a port of my addon for arma1; (original thread here)

Note that while pre-v0.7 versions of the addon still work as-is on A2, it is recommended that you upgrade as it will have key-handler conflicts and might cause breakage

NOTE: Requires CBA!

S_NVG v0.7

You can configure the addon to your preferences at '<arma2 installation folder>\dta\S_NVG\S_NVG.hpp'

Differences to earlier A1 versions;

* It is now disabled by default - A2 HDR is greatly improved from A1, but still has some issues, so this addon needed to be made.

* Much cleaner code.

* Uses A2's new displayEventHandlers, so key conflicts should be gone.

* Keys

* Put key assignments and the default setting in the file \dta\S_NVG\S_NVG.hpp, so those who don't like the defaults can change it

Future plans and current issues;

* No known bugs at the moment.. only concerns listed below.

* Are there any multiplayer issues? I don't play online much so i wouldn't know.

* displayEventHandlers still won't carry over a savegame, so to make it work i'm removing and re-adding them every second - is there a better way around this and are there any issues expected with this?

* I tried to launch the addon with Extended_PostInit_EventHandlers, as it should be ran only once and would save me from another global variable, but it didn't work - perhaps i'm misunderstanding it's functionality? (CBA bug - thanks spooner)

Edited by sholio

Share this post


Link to post
Share on other sites

Love the addon. The effect that HDR had with stars at night when wearing NVGs was really annoying. However, I have encountered a really odd bug.

The addon works for all units apart from all of the Force Recon units on the BLUFOR side. I have no idea why, but it doesn't initialize for them. :confused:

Share this post


Link to post
Share on other sites

PreInit and PostInit are only run once. You are quite correct and thus you don't need the usual global-variable test to stop it happening more than once. The former is run before any objects are created, the latter after they are created. In your case, you might as well use PreInit unless you need the player object for something. The syntax for the once-only handlers is a bit different though (not associated with an object class):

class Extended_PreInit_EventHandlers
{
   S_NVG = "[] execVM '\S_NVG\init.sqf'";
};

CBA has just been hot-fixed, by the way, since the first release was a little bit borked. Sorry, I realise you were probably waiting to release until you had an official XEH to use, but anyway, everything is fine now (fingers crossed!).

@Zipper: The FR should work with the new version of CBA... Sorry, that was our fault, not sholio's!

Edited by Spooner

Share this post


Link to post
Share on other sites

Yeah, I found that just now, Spooner. Heh, sorry sholio. I guess the version Armaholic has on the website is outdated.

Share this post


Link to post
Share on other sites

We only released the new version in the last couple of hours. They probably haven't updated yet.

Share this post


Link to post
Share on other sites
* displayEventHandlers still won't carry over a savegame, so i'm removing and re-adding them every second - is there a way around this and are there any issues expected with this?

So is the official stance this isn't SP save friendly (ATM) like in Arma1 - loading causes it not to run anymore?

Share this post


Link to post
Share on other sites

Great addition and improvement for a better game :)

Thank you!

Share this post


Link to post
Share on other sites

no more disco balls in the sky....

awesome!!

:yay:

Share this post


Link to post
Share on other sites
So is the official stance this isn't SP save friendly (ATM) like in Arma1 - loading causes it not to run anymore?

singleplayer saves work - that's what i meant

to make it work i remove and add it again once every script cycle

when you load a savegame, it removes a then nonexistent key and adds it back on again

the issues listed are just for people who might have better ideas on how to solve the issue

Share this post


Link to post
Share on other sites

Sorry mate I should have read that clearer.

Well that is a mod keeper from here and the future then, great work, and needed as a "usual suspect" mod.

Share this post


Link to post
Share on other sites

Thanks mate!

How is it different to GDTMod_HDR by HeinBloed?

Can you please move the external configuration file to:

.\arma2\userconfig\YourFolder.

Thanks :)

Share this post


Link to post
Share on other sites
So is the official stance this isn't SP save friendly (ATM) like in Arma1 - loading causes it not to run anymore?

Save games have nothing to do with SP any more :P

Although this addon uses an inefficient workaround to deal with the issue, it should work fine with SP or MP saves. Unfortunately, there isn't really a better way to deal with this at present...

We are looking at adding a simple framework to manage this in CBA. Even if this just means that we get to inefficient once on behalf of all CBA-dependent addons :D

Share this post


Link to post
Share on other sites
How is it different to GDTMod_HDR by HeinBloed?

Can you please move the external configuration file to:

.\arma2\userconfig\YourFolder.

uses extended eventhandlers, focuses on night vision only and probably works better due to it's legacy

also, using mouse wheel to adjust is a poor idea i think

i couldn't find any common consensus on addon config files so i used the folder structure ACE did

i may change it for the future if it becomes common

Share this post


Link to post
Share on other sites

Thanks for the info. You can configure any key for GDTMod HDR.

.\userconfig is used by ACE2, PROPER projects, ACEIP, OFPIP and Deadfast. :)

Share this post


Link to post
Share on other sites

Great mod but one suggestion to improve it. Could u add a default arperture value parameter in the S_NVG.hpp file. By default it kicks in just abit to high, personaly i find 7,5-8,5 the best.

This way u get a good initial setting and can adjust it later if it needs situational adjustments.

Share this post


Link to post
Share on other sites

I changed it myself so it initialy is on manual with a value defined in the config. Works great and needed 2 lines of code.

Im new to arma2 scripting and I want to modify/finetune this mod abit, so i can learn how to do this. I hope u wont mind, not releasing it tho. If im done with my wishlist is done ill let u know so u can implement them or laugh at my scripting skills :)

things im gonna try todo

- manual arperture value from config file (done)

- When playing on a higher setting then regular i want a nice animation which represents the manual adjusting of the nv goggle, or atleast a little 'pause' so u cant shoot while adjusting the goggles. (WIP)

- Remove the overlay when switched to 3rd person or commannder view (WIP)

Ill keep u updated :)

Share this post


Link to post
Share on other sites

Re the loading of save games, afaik this can be found by verifying the time/tick time. We will evaluate and add this system to CBA when possible.

It is recommended to use the CBA system:

http://dev-heaven.net/docs/cba/files/events/fnc_addKeyHandlerFromConfig-sqf.html

http://dev-heaven.net/docs/cba/files/events/fnc_addKeyHandler-sqf.html

(sry for lack of documentation for this function atm).

- The system used in CBA, to run events connected to various keys, is a very efficient one. It uses an array, where the index of the array is the actual key number. The entry contains another array with code entries. If the array is empty, nothing is ran, if there is code, it will be ran

- (Future) One unified DEH system that checks for savegame/load state and reattaches

Usage goes like this:

Method a) Script

InitScript:

[33, [true, false, false], { _this call FUNC(keyPressed)}] call CBA_fnc_addKeyHandler;

If you don't use CBA Macros:

[33, [true, false, false], { _this call ace_sys_attachments_fnc_keyPressed)}] call CBA_fnc_addKeyHandler;

(array == [shift, ctrl, alt])

Method b) Config

Config:

class CfgSettings
{
class CBA
{
 class events
 {
  class ace_sys_attachments
  {
   class cqb
   {
      key = 33;
      shift = 1;
   };
  };
 };
};
};

InitScript:

[quote(ADDON), "cqb", { _this call FUNC(keyPressed)}] call CBA_fnc_addKeyHandlerFromConfig;

If you don't use CBA Macros:

["ace_sys_attachments", "cqb", { _this call ace_sys_attachments_fnc_keyPressed)}] call CBA_fnc_addKeyHandlerFromConfig;

Edited by Sickboy

Share this post


Link to post
Share on other sites
- manual arperture value from config file (done)

- When playing on a higher setting then regular i want a nice animation which represents the manual adjusting of the nv goggle, or atleast a little 'pause' so u cant shoot while adjusting the goggles. (WIP)

- Remove the overlay when switched to 3rd person or commannder view (WIP)

-default aperture is in config for next version

-animation? i don't get what you mean

-you can use seperate overlay addons in conjuntion.. for example, the fullscreen nvg addon works fine

also, modifying an addon will break it's ties to the signed key, in case you play online

snip

thanks, i'll look into it

Share this post


Link to post
Share on other sites

animation..

When playing in veteran mode (for example) and manual adjusting the arperture, I would like to see a little animation, lets say for example a salute. Which basicly makes it impossible to shoot right away. U will have to wait till the animation is finished to return to the combat ready modus. (much like reloading a gun). Im still looking for a good animation reference so i can put something in which looks realistic.

I understand i can use both addons to achieve it but preferably i have one NV goggle addon which deals with both issues. Like i said its just a little bit of experimenting with the script language.

Share this post


Link to post
Share on other sites

removed.

Edited by sirex

Share this post


Link to post
Share on other sites

Hey guys, I am new to ArmA 2 and all I know about addons is -> put the pbo files into @"modname" folders and put that in the back of the shortcut. I have a lot of addons running already.

So I got the CBA in @CBA and put it into the shortcut. Also I downloaded the Fixed Range Nightvision.

What to do with the files?

I've put the "addons" folder into @NV and added it to my shortcut. The Data and Keys folders I put into ArmA2 main folder, since there are already folders named like that.

In the SAS campaign I'm playing right now I can not see any change, the HDR is still on. Should I try to start a new game? Did I understand the folder thing correctly? Did I put everything into the right spots?

Is that correct?

Ok, it just worked in the editor. There is a "enable/disable auto adjust" option, which I did not see yet (yeah, I am new...:D), lets see how that works out with my savegames.

Edited by megagoth1702

Share this post


Link to post
Share on other sites

Hello there, looking at the NV addon you will need the NVG config located in the dta folder, so.....

1. Make sure your CBA is up to date, place the @CBA folder in your main dir.

2. Choose you mod folder for the NV, so like you said @NVG would be fine, then add that to the main dir.

3. Locate the S_NVG folder in the dta folder that came with the download. Place this into the dta folder in the main dir.

4. Example shortcut :-

"C:\Program Files\Bohemia Interactive\ArmA 2\arma2.exe -mod=@CBA;@NVG"

Try that, it should work. I would recommend using ACE2, it has all the NVG stuff built in, plus many more features.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×