Advertisement

Author Topic: Camera Target Loop..??  (Read 363 times)

0 Members and 1 Guest are viewing this topic.

Offline ahmed117

  • Members
  • *
  • The 3d!t0R -=I.S.I=-
Camera Target Loop..??
« 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
« Last Edit: 05 Jul 2012, 14:56:04 by ahmed117 »
The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-

Offline Gruntage

  • Moderator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Camera Target Loop..??
« Reply #1 on: 18 May 2012, 08:53:37 »
You basically use a loop within the camera script, with a condition for when you want the loop to stop. For example:

Code: [Select]
#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
Some of the most memorable missions made involve the player doing very little...

"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline ahmed117

  • Members
  • *
  • The 3d!t0R -=I.S.I=-
Re: Camera Target Loop..??
« Reply #2 on: 18 May 2012, 10:20:43 »
Bro! I pasted this line in the middle of the script...

Code: [Select]
#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...
The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-

Offline Gruntage

  • Moderator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Camera Target Loop..??
« Reply #3 on: 18 May 2012, 10:25:48 »
Try replacing 'peterson' with:

Code: [Select]
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.
Some of the most memorable missions made involve the player doing very little...

"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline ahmed117

  • Members
  • *
  • The 3d!t0R -=I.S.I=-
Re: Camera Target Loop..??
« Reply #4 on: 19 May 2012, 05:42:16 »
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..
Code: [Select]
#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 . :)
The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-