OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ahmed117 on 18 May 2012, 08:29:09
-
Hi Guys,
I jumped up again in the world of OPF after a long time.. :D . Anyway, I've got a question of the camera loop, that how can we set a loop of a certain target . for example, we want to set the camera target on a driver of a jeep and the camera should remain fixed over the driver? So, how to make a loop or anything else for this?
Thank you,
Ahmed.
YouLikeHits.com (http://"http://www.YouLikeHits.com?x=216399")
-
You basically use a loop within the camera script, with a condition for when you want the loop to stop. For example:
#LOOP
? showt72: goto "NEXT"
_camera camSetTarget a101
_camera camSetRelPos [-1.27,+7,+1.6]
_camera camsetFOV 1.300
_camera camCommit 0
@camcommitted _camera
goto "LOOP"
'showt72' is the variable that cancels the loop. This example was taken from one of my missions. 'Showt72' was made true when the planes reached a certain point on the map (when they entered a trigger).
The example above basically keeps the camera at a certain point in relation to a vehicle (see the command: CamSetRelPos in the COMREF).
There are a few scripts out there (see editors depot) that do the same job. I only needed a small loop for only a short amount of time and this seemed to be the most efficient method.
Hope this helps
Gruntage
-
Bro! I pasted this line in the middle of the script...
#LOOP
? showt72: goto "NEXT"
_camera camSetTarget peterson
_camera camSetRelPos [-1.27,-0.1,0.5]
_camera camsetFOV 0.700
_camera camCommit 0
@camcommitted _camera
goto "LOOP"
but still the camera don't shows the relevant target, how do I fix it? I want the Camera to fix on the driver of the jeep.. :( the driver's name is Peterson...
-
Try replacing 'peterson' with:
driver _vehicle
where _vehicle is the name of the vehicle being used. You'll obviously need to alter the relpos values a little bit.
If that doesn't work, just target the vehicle and move the camera around so that it looks like it's facing where the driver is.
-
Sir, you gave a best idea for the loop.. but it was not working for me. But I took little help from the COMREF and I Modified it a little, and now its working for me... they are something like this..
#LOOP
? showt72: goto "NEXT"
_camera camSetTarget getpos jeep1
_camera camSetRelPos [5,-0.01,1]
_camera camsetFOV 0.700
_camera camCommit 0
@camcommitted _camera
goto "LOOP"
#NEXT
while jeep1 was my target to be shown in the cam... Thank you for your help.Sir . :)