OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: swtx on 15 May 2007, 05:10:47
-
I'm trying to mount a fixed camera to an A10, but I'm having trouble.
I'm using this code:
;--Vehicle-cam----------------------------------------------------------
vehiclecamstop = false
#loop
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "front"]
_cam camsettarget A10
_cam camsetrelpos [0, 5, 10]
#commit
_cam camcommit 0
_cam camsettarget A10
_cam camcommit 0
~0.01
? NOT(vehiclecamstop) : goto "loop"
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
Everytime I execute the script I get a pretty shot of the ocean.
Is there anyway I can fix this ?
-
_cam camsettarget A10
i believe you see the pretty ocean because Arma is looking for an object called A10 and can't find it...try renaming the jet. (or chaning the script to reflect the aircrafts NAME/not what kind it is.)
Also this is a must read for cutscene makers:
http://www.ofpec.com/forum/index.php?topic=28923.0
-
Create the camera before your loop starts, not inside your loop.
-
Hi
How can i camera follow vehicle script to SQF format??
I am still not grasping the transition from goto "loop" ..... into SQF
can someone explain or point me in the right direction.
PS i have read through Cheetas Basic SQS tut
thanks
-
Something quite basic to start with:
//followplane.sqf
_plane = _this select 0;
keepfollowing = true;
_cam = "camera" camcreate [0, 0, 0];
_cam cameraeffect ["internal", "back"];
_relpos = [-25, 10, 5];
_cam camSetRelPos _relpos;
_cam camSetTarget _plane;
_cam camSetFov 1;
_cam camCommit 0;
while {keepfollowing} do
{
_cam camSetRelPos relpos;
_cam camCommit 0.2;
Sleep 0.01;
};
_cam cameraeffect ["terminate", "back"];
camDestroy _cam;
To execute:
res=[myplane]execVM"followplane.sqf"
Note that you may set global variable keepfollowing to true in case you want to stop the script.
-
Thats excellent mate thanks
I can learn from what you have showed me
Cheers
wedge :D
-
Thanks for your help gents, problem solved :good: