OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NightJay0044 on 10 Mar 2009, 07:51:09

Title: Camera scripting issues
Post by: NightJay0044 on 10 Mar 2009, 07:51:09
Hi, why is it, everytime I copy and paste a camera script I've previously used before and has worked perfectly fine then.

Then when I copy and paste it into a new mission and just change the target names, it never works!

Arrgggh..

Here is the script.

Quote
titlecut ["","black in",1]
_cam = "camera" camCreate [0,0,0]
_cam cameraeffect ["Internal", "back"]


;Wait a moment.
~5

;Play Dialogue.
PlayMusic "Scene1"

; point the camera at the player, and place it 2m to the players left,
; 10m to his front and 3m above the ground
_cam camsettarget player
_cam camsetrelpos [1,-10,3]
_cam camcommit 0

~200

; end cutscene
_cam cameraeffect ["terminate", "back"]
camdestroy _cam

; fade back in over 2 seconds
titlecut [" ","BLACK IN",2]

exit


Seems fine, but the view is of the ocean throughout the whole script. How do I make it start at the player?

Or any target for that matter.....

Thanks..
Title: Re: Camera scripting issues
Post by: Worldeater on 10 Mar 2009, 08:14:19
It should work if you replace...

  _cam = "camera" camCreate [0,0,0]

...with...

  _cam = "camera" camCreate (getPos player)

Title: Re: Camera scripting issues
Post by: NightJay0044 on 10 Mar 2009, 17:51:49
Yeah that didn't work, it's wierd. 

It shows the ocean for like 5-8 seconds then the cutscene starts...

It did that before you gave me the code   :dunno:
Title: Re: Camera scripting issues
Post by: savedbygrace on 21 Mar 2009, 11:02:43
Try placing your 5 second delay after you set the relative position of the camera. Your creating it at 0,0,0 grid and then never changing it's position until you set it relative to the player, 5 seconds later.