Jump to content
Sign in to follow this  
damotr

Red dot in night vision problem

Recommended Posts

Hi guys.

I'm trying to make nice red dot i CWA. End up with this problem:

Is there any possibility to make this red dot appears green in night vision?

Edit:
And do it without killing "shining" parameter.

 

coldwarassault_2017_11_06_09_19_55_58_ko

Share this post


Link to post
Share on other sites

The red dot is part of the optics texture for the gun. It has nothing to do with the NVgoggles. If you remove it, it will be gone from the weapon optics all the time.

  • Like 1

Share this post


Link to post
Share on other sites

Personally I don't know of any way to dynamically change the colour of the texture. Maybe, if you could get a hook from user actions you could script something. But I don't believe that's an option. And setobjecttexture may not be compatible with optic models anyway.

 

Share this post


Link to post
Share on other sites

Really nothing you can do. Animations and/or setobjecttexture tricks are impossible on weapon optics in OFP/CWA. Hell - every single animated slide on pistols in OFP is not really animated, but cleverly used "zasleh" selection.

 

Since you're using FWatch to detect NV goggles being on (at least that's what I remember from the "NV scopes" thread), you may write a script that would replace the gun in your hands to the one with green dot on the model when you're aiming with NV on. Naturally it would need a "sort of database" with all the guns specified (so it wouldn't be plug and play with 3rd party addons).

 

Now, what may be worth experimenting, is ditching the vanilla NV post-processing, and using FWatch to somehow control external renderer/post-effect hook to achieve NV effect. IIRC @the_noob experimented with NV and "fake thermal" (more like "white NV") in Sweet FX.

  • Like 2

Share this post


Link to post
Share on other sites

It'll require making new DXDLL/Injector and thats's not what I'm capable of.

 

But:

 

Textures of optics have "user" parameter and - as far as I figured that out - it says if other parameters can be "skipped".

 

User 0, Light shining - texture is shining and "over" night vision filter.

 

User 1, Light shining - texture is NOT shining and "under" night vision filter (become "greened").

 

So it should be possible without scripting/animating. Maybe other values?

 

Or I misunderstand the meaning User parameter.

Share this post


Link to post
Share on other sites

The user value is for setting up "damage" materials for different parts of a model.  So the specific part darkens as it's damaged. That won't affect the rendering order,as far as I'm aware.

  • Like 1

Share this post


Link to post
Share on other sites

:yeahthat:What Macser said! 

 

7 hours ago, damotr said:

User 0, Light shining - texture is shining and "over" night vision filter.

 

User 1, Light shining - texture is NOT shining and "under" night vision filter (become "greened").

 

Actually, the optics are all the time "under" NV effect (or rather NV is rendered in the foreground). The change of appearence you see is related only to the shining properity, and as I've learned the hard way - changing user value from 0 to 1 makes game ignore shining settings. In fact, if you'll look closely, you'll notice that even with shining red dot, you can see a change of appearence when switching NV on and off. However, since it is shining, it emits a red light of sorts, and so it doesn't get all green.

 

The only way in OFP/CWA engine to modify something on model in-game is to either use hiddenSelections (hide/show model parts) or setobjecttexture (change the texture of some small parts - IIRC there's limit for a texture size in OFP). However, from my experience, it doesn't work on weapon/optic models (and even if it'd work, you'd still need a script to achieve your desired effect).

Share this post


Link to post
Share on other sites

Okay... here we go again :) Impossible can be done pretty easy. With fwatch...
 

 

I've created resource objects with red and green dot in the middle - like binocular type one.
No aimpoint scope model has it's own red dot

As in my NV-Scopes script: FOV is crucial

Every Aimpoint weapon in my mod has "opticsZoomMin=0.421" and "opticsZoomMax=0.421" instead of normal "0.420"

Every unit has following script in it's init:

Quote

_soldier = _this select 0

[] exec "..\fwatch\data\MemMulti.sqs"

 

;exetudet only on player
if (_soldier==PLAYER) then {} else {exit}

 

#loop
~0.01

; check if hasweapon with aimpoint
if ((primaryweapon _soldier) in ["M16A2_Aimpoint","M16A2B_Aimpoint","CAR15_Aimpoint","CAR15B_Aimpoint","CAR15_SD_Aimpoint","M16A2_M203_Aimpoint","CAR15_M203_Aimpoint","CAR15_SD_M203_Aimpoint","M14_Aimpoint","M14B_Aimpoint","M14_SD_Aimpoint","MP5A4_Aimpoint","MP5SD6_Aimpoint","M60E4_Aimpoint"]) then {} else {goto "loop"}


;check if it's not in vehicle

if ((typeof (vehicle _soldier))==(typeof (_soldier))) then {} else {goto "loop"}

_fov = format ["%1",(FWATCH_MEM_MULTI select 0) select 5]
_nv = format ["%1",(FWATCH_MEM_MULTI select 2)]


;check if using Aimpoint

if (format["%1",_fov]=="0.561333") then {goto "aimpoint_start"} else {}
goto "loop"

 

#aimpoint_start
_mem_fov = _fov
_mem_nv = _fov
if (_nv=="true") then {titleRsc ["RedDotNV", "PLAIN DOWN"]} else {titleRsc ["RedDot", "PLAIN DOWN"]}

;Above - show correct version on red dot

 

#interloop
~0.01
_fov = format ["%1",(FWATCH_MEM_MULTI select 0) select 5]
_nv = format ["%1",(FWATCH_MEM_MULTI select 2)]
if (_mem_fov!=_fov) then {goto "end_aim"} else {}
if (_mem_nv!=_nv) then {goto "aimpoint_start"} else {}
goto "interloop"

 

#end_aim
titleText ["", "PLAIN"]
goto "loop"

 

  • Like 4

Share this post


Link to post
Share on other sites
56 minutes ago, damotr said:

Okay... here we go again :) Impossible can be done pretty easy. With fwatch...

I told ya! :hehe:

 

Have to say, it looks pretty damn good! Interesting approach with using resource, instead of "proper" sight model. I was suggesting (inspired by Kenoxite's approach in WW4Ext) a script that would change the weapon (with two variants - one with red dot, and other with green dot), but that not only requires at least two scope view models for every sight, but also introduces problem of magically replenishing magazines when switching NVGs on or off.

 

I am impressed!

Share this post


Link to post
Share on other sites

Glad to see you got something going. It looks very nice. :thumbsup:

 

Welcome to the world of work-arounds.

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  

×