Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Cobra on September 23, 2011, 02:52:37 am

Title: Set-camera-target SEXP broken?
Post by: Cobra on September 23, 2011, 02:52:37 am
Obviously I'm FREDing a cutscene here. I'm trying to pull off a kind of 'ship flies over camera and camera turns to track it' effect. However, when the SEXP triggers, the camera tracks it but there's nothing on screen. I don't know if I'm just doing it wrong or if it's actually broken.

Code: [Select]
$Formula: ( when
   ( <
      ( distance
         "Alpha 1"
         "Waypoint path 3:3"
      )
      100
   )
   ( set-camera-target "Alpha 1" )
)
+Name: Camera Follows Me
+Repeat Count: 1
+Interval: 1
Title: Re: Set-camera-target SEXP broken?
Post by: The_Force on September 23, 2011, 02:57:25 am
Use every time and set-camra-facing-object
Title: Re: Set-camera-target SEXP broken?
Post by: zookeeper on September 23, 2011, 03:09:18 am
set-camera-target doesn't make the camera face the target, it just makes it move the same way the target moves. Most of the time you want to first make it face the target, and then use set-camera-target to make it follow the target.
Title: Re: Set-camera-target SEXP broken?
Post by: Nuke on September 23, 2011, 05:40:33 am
yep, thats what that does. i think you need to be using set-camera-facing-object. now if you wanted to view an object from another object then you would use set-camera-target on the ship you want to observe from and then set-camera-facing-object on the object you want to watch. set-camera-target just puts the camera in an objects frame of reference, anything you do after that is relative tot he target instead of world (at least thats how it works in scripting, but the sexps use the same function calls). should probably move this to an appropriate forum.
Title: Re: Set-camera-target SEXP broken?
Post by: Axem on September 23, 2011, 07:23:40 am
Thread tl;dr: Make sure you set camera orientation to 0 0 0. :)
Title: Re: Set-camera-target SEXP broken?
Post by: Rodo on September 23, 2011, 07:39:40 am
It's a wacky sexp, it does not what you'd expect.

Try this, before using that sexp, reset the camera, then use set-camera-facing-object, and only then use set-camera-target.