TymC 10 Posted February 9, 2014 Hi guys! Hope you can help me, I've been using granQ's "Cam Scenes" for tracking vehicles, but when I try and track vehicles which are moving too fast (Jets) the camera jerks. It zooms in close then pops back ever half a second or so. This is the script; I was wondering if anyone could help me fix the problem? Cheers! (I have looked and couldn't find too much) /* Made by granQ 2010Start with the following code my_Camera = [car1,1000,"chase side"] execVM "cam_scenes.sqf"; object = name of any vehicle/object ingame that you want the camera to focus on. duration, in seconds how long do you want the scene to be. "type", the style you want. Replace with any of the following: "zoom" "zoom top" "chase" "chase side" "chase angle" "fly in" "fly around" "static" */ _object = _this select 0; _duration = _this select 1; _type = _this select 2; if (_type == "zoom") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _cam camPrepareTarget _object; _cam camPreparePos [(getpos _object select 0)- 30,(getpos _object select 1)+20, 2]; _cam camCommitPrepared 0; _cam camPrepareFOV 0.100; //zoom lense 0.100 zoom in, 1.700 zoomed right out _cam camCommitPrepared _duration; sleep _duration; _cam camPrepareFOV 0.700; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "zoom top") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _cam camPrepareTarget _object; _cam camPreparePos [(getpos _object select 0),(getpos _object select 1), 100]; _cam camCommitPrepared 0; _cam camPrepareFOV 0.100; //zoom lense 0.100 zoom in, 1.700 zoomed right out _cam camCommitPrepared _duration; sleep _duration; _cam camPrepareFOV 0.700; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "chase") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _i = 0; while {_i < _duration / 0.1} do { _i = _i + 1; _cam camPrepareTarget _object; _cam camPrepareRelPos [0,-5,1.4]; _cam camCommitPrepared 0; sleep 0.1; }; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "chase side") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _i = 0; while {_i < _duration / 0.1} do { _i = _i + 1; _cam camPrepareTarget _object; _cam camPrepareRelPos [1,0,1.4]; _cam camCommitPrepared 0; sleep 0.1; }; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "chase angle") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _i = 0; while {_i < _duration / 0.1} do { _i = _i + 1; _cam camPrepareTarget _object; _cam camPrepareRelPos [-4,-5,3]; _cam camCommitPrepared 0; sleep 0.1; }; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "fly in") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _cam camPrepareTarget _object; _cam camPreparePos [(getpos _object select 0)- 40,(getpos _object select 1)+40, 12]; _cam camCommitPrepared 0; _cam camPreparePos [(getpos _object select 0)- 3,(getpos _object select 1)+3, 2]; _cam camCommitPrepared _duration; sleep _duration; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "fly around") then { _duration_4 = _duration / 4; _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _cam camPrepareTarget _object; _cam camPreparePos [(getpos _object select 0),(getpos _object select 1)+10, 5]; _cam camCommitPrepared 0; _cam camPreparePos [(getpos _object select 0)+10,(getpos _object select 1), 5]; _cam camCommitPrepared _duration_4; sleep _duration_4; _cam camPreparePos [(getpos _object select 0),(getpos _object select 1)-10, 5]; _cam camCommitPrepared _duration_4; sleep _duration_4; _cam camPreparePos [(getpos _object select 0)-10,(getpos _object select 1), 5]; _cam camCommitPrepared _duration_4; sleep _duration_4; _cam camPreparePos [(getpos _object select 0),(getpos _object select 1)+10, 5]; _cam camCommitPrepared _duration_4; sleep _duration_4; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; if (_type == "static") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; _cam camPrepareTarget _object; _cam camPreparePos [(getpos _object select 0)- 7,(getpos _object select 1)+4, 2]; _cam camCommitPrepared 0; sleep _duration; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; Share this post Link to post Share on other sites
wombat50 3 Posted February 15, 2014 On occasion, I have trouble with camera stuttering too. I use sqs and I think your example is sqf which I know very little about. Recently tried this in sqs when stuttering camera occurred. Every camera block in sqs contains the line _camera camCommit 0 Not sure but _cam camCommitPrepared 0; might be the same thing in your example? Anyways for me, in _camera camCommit 0 the zero means the camera will move to its new location instantly. So in my case to try to get rid of camera stutter I changed the zero to a one. This helped. Only tried this today by trial and error so it may not be foolproof. In one loop block I only had to change the zero to .1. In another I had to change the 0 to a 1 to eliminate the camera stutter. Share this post Link to post Share on other sites
f2k sel 164 Posted February 15, 2014 I eliminated it another way or at least I think I have. first I changed the way you set the duration as I needed to adjust sleep as well _duration = time + (_this select 1); then a few small changes in the camera loop //example chase side if (_type == "chase side") then { _cam = "camera" camcreate [0,0,0]; _cam cameraeffect ["internal", "back"]; _cam camPrepareFOV 0.700; while {_duration > time} do { _cam camPrepareTarget _object; _cam camPrepareRelPos [1,0,1.4]; _cam camCommitPrepared 0; sleep 0.005; }; _cam cameraeffect ["terminate", "back"]; camdestroy _cam; }; 1 Share this post Link to post Share on other sites