Jump to content
Sign in to follow this  
SSG J. Switch

Issues with thermal optic modes in camera.sqf

Recommended Posts

I'm trying to use the different optics modes (NV, white hot, black hot) using the "classic camera script by Karel Moricky". It is the camera.sqf script below, posted in many places. However, it sometimes gives me proper thermal images, like you would see using a TWS scope or from the gunner seat of the AH-64 Apache or other gunships.

I get this view though more often than not, especially on user created maps. Can anyone explain what is going on and what I'm doing wrong? The NV seems to be fine, it's just the therma

arma2oa%202012-08-20%2000-46-38-32.png

arma2oa%202012-08-20%2000-46-39-56.png

http://armadepot.com/screenshots/arma2oa%202012-08-20%2000-46-46-76.png (2892 kB)

//--- Classic camera script, enhanced by Karel Moricky, 2010/03/19 

if (!isNil "BIS_DEBUG_CAM") exitwith {}; 

//--- Is FLIR available 
if (isnil "BIS_DEBUG_CAM_ISFLIR") then { 
   BIS_DEBUG_CAM_ISFLIR = isclass (configfile >> "cfgpatches" >> "ca_E"); 
}; 

BIS_DEBUG_CAM_MAP = false; 
BIS_DEBUG_CAM_VISION = 0; 
BIS_DEBUG_CAM_FOCUS = 0; 
BIS_DEBUG_CAM_COLOR = ppEffectCreate ["colorCorrections", 1600]; 
if (isnil "BIS_DEBUG_CAM_PPEFFECTS") then { 
   BIS_DEBUG_CAM_PPEFFECTS = [ 
       [1, 1, -0.01, [1.0, 0.6, 0.0, 0.005], [1.0, 0.96, 0.66, 0.55], [0.95, 0.95, 0.95, 0.0]], 
       [1, 1.02, -0.005, [0.0, 0.0, 0.0, 0.0], [1, 0.8, 0.6, 0.65],  [0.199, 0.587, 0.114, 0.0]], 
       [1, 1.15, 0, [0.0, 0.0, 0.0, 0.0], [0.5, 0.8, 1, 0.5],  [0.199, 0.587, 0.114, 0.0]], 
       [1, 1.06, -0.01, [0.0, 0.0, 0.0, 0.0], [0.44, 0.26, 0.078, 0],  [0.199, 0.587, 0.114, 0.0]] 
   ]; 
}; 

//--- Undefined 
if (typename _this != typename objnull) then {_this = cameraon}; 

private ["_ppos", "_pX", "_pY"]; 
_ppos = getPosATL _this; 
_pX = _ppos select 0; 
_pY = _ppos select 1; 
_pZ = _ppos select 2; 

private ["_local"]; 
_local = "camera" camCreate [_pX, _pY, _pZ + 2]; 
BIS_DEBUG_CAM = _local; 
_local camCommand "MANUAL ON"; 
_local camCommand "INERTIA OFF"; 
_local cameraEffect ["INTERNAL", "BACK"]; 
showCinemaBorder false; 
BIS_DEBUG_CAM setDir direction (vehicle player); 


//--- Marker 
BIS_DEBUG_CAM_MARKER = createmarkerlocal ["BIS_DEBUG_CAM_MARKER",_ppos]; 
BIS_DEBUG_CAM_MARKER setmarkertypelocal "mil_start"; 
BIS_DEBUG_CAM_MARKER setmarkercolorlocal "colorpink"; 
BIS_DEBUG_CAM_MARKER setmarkersizelocal [.75,.75]; 
BIS_DEBUG_CAM_MARKER setmarkertextlocal "BIS_DEBUG_CAM"; 


//--- Key Down 
_keyDown = (finddisplay 46) displayaddeventhandler ["keydown"," 
   _key = _this select 1; 
   _ctrl = _this select 3; 

   if (_key in (actionkeys 'nightvision')) then { 
       BIS_DEBUG_CAM_VISION = BIS_DEBUG_CAM_VISION + 1; 
       if (BIS_DEBUG_CAM_ISFLIR) then { 
                   _vision = BIS_DEBUG_CAM_VISION % 4; 
           switch (_vision) do { 
               case 0: { 
                   camusenvg false; 
                   call compile 'false SetCamUseTi 0'; 
               }; 
               case 1: { 
                   camusenvg true; 
                   call compile 'false SetCamUseTi 0'; 
               }; 
               case 2: { 
                   camusenvg false; 
                   call compile 'true SetCamUseTi 0'; 
               }; 
               case 3: { 
                   camusenvg false; 
                   call compile 'true SetCamUseTi 1'; 
               }; 
           }; 
       } else { 
           _vision = BIS_DEBUG_CAM_VISION % 2; 
           switch (_vision) do { 
               case 0: { 
                   camusenvg false; 
               }; 
               case 1: { 
                   camusenvg true; 
               }; 
           }; 
       }; 
   }; 

   if (_key in (actionkeys 'showmap')) then { 
       if (BIS_DEBUG_CAM_MAP) then { 
           openmap [false,false]; 
           BIS_DEBUG_CAM_MAP = false; 
       } else { 
           openmap [true,true]; 
           BIS_DEBUG_CAM_MAP = true; 
           BIS_DEBUG_CAM_MARKER setmarkerposlocal position BIS_DEBUG_CAM; 
           BIS_DEBUG_CAM_MARKER setmarkerdirlocal direction BIS_DEBUG_CAM; 
           mapanimadd [0,0.1,position BIS_DEBUG_CAM]; 
           mapanimcommit; 
       }; 
   }; 

   if (_key == 55 || _key == 83) then { 
       _worldpos = screentoworld [.5,.5]; 
       if (_ctrl) then { 
           vehicle player setpos _worldpos; 
       } else { 
           copytoclipboard str _worldpos; 
       }; 
   }; 
   if (_key == 83 && !isnil 'BIS_DEBUG_CAM_LASTPOS') then { 
       BIS_DEBUG_CAM setpos BIS_DEBUG_CAM_LASTPOS; 
   }; 

   if (_key == 41) then { 
       BIS_DEBUG_CAM_COLOR ppeffectenable false; 
   }; 
   if (_key >= 2 && _key <= 11) then { 
       _id = _key - 2; 
       if (_id < count BIS_DEBUG_CAM_PPEFFECTS) then { 
           BIS_DEBUG_CAM_COLOR ppEffectAdjust (BIS_DEBUG_CAM_PPEFFECTS select _id); 
           BIS_DEBUG_CAM_COLOR ppEffectCommit 0; 
           BIS_DEBUG_CAM_COLOR ppeffectenable true; 
       }; 
   }; 
"]; 

//--- Mouse wheel moving 
_mousezchanged = (finddisplay 46) displayaddeventhandler ["mousezchanged"," 
   _n = _this select 1; 
   BIS_DEBUG_CAM_FOCUS = BIS_DEBUG_CAM_FOCUS + _n/10; 
   if (_n > 0 && BIS_DEBUG_CAM_FOCUS < 0) then {BIS_DEBUG_CAM_FOCUS = 0}; 
   if (BIS_DEBUG_CAM_FOCUS < 0) then {BIS_DEBUG_CAM_FOCUS = -1}; 
   BIS_DEBUG_CAM camcommand 'manual off'; 
   BIS_DEBUG_CAM campreparefocus [bIS_DEBUG_CAM_FOCUS,1]; 
   BIS_DEBUG_CAM camcommitprepared 0; 
   BIS_DEBUG_CAM camcommand 'manual on'; 
"]; 

_map_mousebuttonclick = ((finddisplay 12) displayctrl 51) ctrladdeventhandler ["mousebuttonclick"," 
   _button = _this select 1; 
   _ctrl = _this select 5; 
   if (_button == 0) then { 
       _x = _this select 2; 
       _y = _this select 3; 
       _worldpos = (_this select 0) posscreentoworld [_x,_y]; 
       if (_ctrl) then { 
           _veh = vehicle player; 
           _veh setpos [_worldpos select 0,_worldpos select 1,position _veh select 2]; 
       } else { 
           BIS_DEBUG_CAM setpos [_worldpos select 0,_worldpos select 1,position BIS_DEBUG_CAM select 2]; 
           BIS_DEBUG_CAM_MARKER setmarkerposlocal _worldpos; 
       }; 
   }; 
"]; 




//Wait until destroy is forced or camera auto-destroyed. 
private ["_lastpos"]; 
waituntil { 
   if (!isnull BIS_DEBUG_CAM) then {_lastpos = position BIS_DEBUG_CAM}; 
   isNull BIS_DEBUG_CAM 
}; 

player cameraEffect ["TERMINATE", "BACK"]; 
deletemarkerlocal BIS_DEBUG_CAM_MARKER; 
BIS_DEBUG_CAM = nil; 
BIS_DEBUG_CAM_MAP = nil; 
BIS_DEBUG_CAM_MARKER = nil; 
BIS_DEBUG_CAM_VISION = nil; 
camDestroy _local; 
BIS_DEBUG_CAM_LASTPOS = _lastpos; 

ppeffectdestroy BIS_DEBUG_CAM_COLOR; 
(finddisplay 46) displayremoveeventhandler ["keydown",_keyDown]; 
(finddisplay 46) displayremoveeventhandler ["mousezchanged",_mousezchanged]; 
((finddisplay 12) displayctrl 51) ctrlremoveeventhandler ["mousebuttonclick",_map_mousebuttonclick]; 

exit  

---------- Post added at 01:17 AM ---------- Previous post was at 01:06 AM ----------

This is how thermals normally look.

http://armadepot.com/screenshots/arma2oa%202012-08-20%2001-05-36-56.png (242 kB)

http://armadepot.com/screenshots/arma2oa%202012-08-20%2001-05-39-29.png (241 kB)

Share this post


Link to post
Share on other sites

It may have something to do with proper imaging maps if you are using "user" created addons for units/vehicles/islands etc.

Here are some links for reading if you are interested:

Thermal Imaging maps

Transparent Thermal

Cold thermal for non rvmat textures

Everything seemed to work fine when I was using that script. I can do some more testing.

Are all of these shots done at the same time of day?

You are using the default "N" key to cycle through the modes, correct?

Share this post


Link to post
Share on other sites

Are all of these shots done at the same time of day?

You are using the default "N" key to cycle through the modes, correct?

So I took your notes and started messing with the weather and time settings, not just hour but day and month. What I discovered is strange. The thermal view change dramatically based on time of day and month of the year.

For example, Isla Duala's default time/date setting is Dec. 6, 2011 at 9am. Thermal views look "normal" during this date and time for the most part. Just by changing only the time to 2am, the thermals went from shades of gray to black and white. So 9am works, 2am looks broken.

Now take the exact same settings at 2am (broken) and just change the month to July and then at 2am, it works. The only assumption I can make here is that somehow the game has coded time/date based temperature into the RVMATs for vehicles and terrain? I.e. the ground is colder at 2am in December, than 2am in July, therefore it doesn't appear at all on thermals?

Please try it for yourself and see.

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  

×