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

Camera modes in camera.sqs

Recommended Posts

Hey all,

I know you can switch between the different types of camera modes while in the camera.sqs mode. However, is there a way to adjust the brightness of the NV mode? Also, why are the thermal white hot and black hot imaging modes so extreme, there is no detail left in the surrounding "cold" parts of the image, it's nothing like the thermal vision on the TWS scopes or FLIR on SATCOM, UAV or vehicle weapons platforms.

Share this post


Link to post
Share on other sites

If you have OA, there is an enhanced camera script in Common/CA/Data/scripts called camera.sqf, not "sqs"...

Try this one out and see if there is any improvement

Edited by panther42

Share this post


Link to post
Share on other sites
If you have OA, there is an enhanced camera script in Common/CA/Data/scripts called camera.sqf, not "sqs"...

Try this one out and see if there is any improvement

Thanks, different syntax, but I'll give it a go. Is there a detailed list of changes between the camera.sqf vs. camera.sqs listed anywhere?

Share this post


Link to post
Share on other sites

It makes use of the Operation Arrowhead setCamUseTi. I don't believe it uses any of the "red" schemes or thermal.

Don't know if there's a change list, but this is at the top of the file:

Classic camera script, enhanced by Karel Moricky

Works very good, what I have tested.

If you need, I can post the script here for you, or you can open the pbo and check yourself.

Share this post


Link to post
Share on other sites
It makes use of the Operation Arrowhead setCamUseTi. I don't believe it uses any of the "red" schemes or thermal.

Don't know if there's a change list, but this is at the top of the file:

Classic camera script, enhanced by Karel Moricky

Works very good, what I have tested.

If you need, I can post the script here for you, or you can open the pbo and check yourself.

That'd be great if you could post that script. I checked my OA "Common" folder and there are no subfolders, just all the standard PBOs. I am running the Steam version, is there another spot I should try looking?

Share this post


Link to post
Share on other sites

Here you go:

//--- 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

Place this in your mission root folder, or in mission scripts folder. Execute the script via: null = [] execVM "camera.sqf"; or null = [] execVM "scripts\camera.sqf";

Share this post


Link to post
Share on other sites

Place this in your mission root folder, or in mission scripts folder. Execute the script via: null = [] execVM "camera.sqf"; or null = [] execVM "scripts\camera.sqf";

Thanks Panther, so it works great as a stand alone free floating camera, how do I incorporate its functionality into camera scripts, like call it up.

With camera.sqs since it is a built in BIS function, you know how you can LMB, hit esc, and paste the data into a camera script file, something like "scene.sqs" from tutorial videos, can I do the exact same thing using a 3rd party camera script like the one you posted?

Would the following work as an .sqf? I had just started learning how to use .sqs syntax and then people started telling me to use .sqf and I'm admittedly a bit lost inbetween.

showCinemaBorder False;

titlecut [" ","BLACK IN",1]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]

showCinemaBorder False;

;comment "18:55:47";
_camera camSetTarget man1
_camera camPreparePos [7956.18,1811.97,2.00];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0

_camera cameraeffect ["terminate","back"]
camdestroy _camera
end1=true;
exit;

Share this post


Link to post
Share on other sites

For SQF you need to end each line with a ;

Otherwise probably. :)

Share this post


Link to post
Share on other sites
For SQF you need to end each line with a ;

Otherwise probably. :)

Is that really the only difference, just a semicolon?

I know that to enable the script you have to use null = [] execVM "script.sqf"; is there a good sqf resource or guide that explains the differences between the sqs and sqf syntax?

Share this post


Link to post
Share on other sites

Here's one explanation from the wiki:

SQS to SQF conversion

You may be able to execute this script as you would the older sqs. It is in the CA pbo, and gets loaded when the game does. I have not tried this yet...

If so, you may be able to do the LMB, escape, and paste data.

This is not a third party camera script. It was done by the BI developers.

I just tried it. It works the same as the older sqs file.

You do not need the camera.sqf in your mission folder, just use null=[] execVM "camera.sqf"; in a trigger or whatever.

LMB and then paste works.

Edited by panther42

Share this post


Link to post
Share on other sites
Is that really the only difference, just a semicolon?

I know that to enable the script you have to use null = [] execVM "script.sqf"; is there a good sqf resource or guide that explains the differences between the sqs and sqf syntax?

Not at all the only difference, but a major syntax error with the code you posted. :) My webpage linked in my sig has a few links to SQF tutorials and documents.

  • Like 1

Share this post


Link to post
Share on other sites

Kylania's web site is full of good information. Also, I always like to check out the forum posts of some of our most knowledgeable posters. Too many to name them all, and would hate to leave anyone out.

All you have to do is LMB on their name, and select View forum posts, or View forum threads.

These people have spread a vast amount of knowledge on these forums...not to mention regurgitating much of it over and over and over....you get the point.;)

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  

×