Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: starbug on March 29, 2015, 09:16:47 am

Title: How to make a camera track a ship?
Post by: starbug on March 29, 2015, 09:16:47 am
I am trying to make a cutscene showing the Tombaugh station attack and i have run into problems. 1 i want to make a shot of the Halkins and Tarinis jumping in past the camera and for the camera to follow the halkins as she flies past. How do i do this, i have tried to use the Camera_target sexp, as according to the description it should make the camera lock to the Halkins and follow it. When i tried to use it, it totally screwed up the camera position and blocked the halkins from jumping in, even though the sexp is setup to work after the halkins arrival. I also have tried to use the camera rotation to achieve the effect but with no success, i just cant get the shot i want. Yet i have seen some truly wonderful tracking shots in the intro to BP2 war in heaven part 2. How do you make a tracking shot were the camera follows a ship now?

Also i have noticed the camera face object SEXP doesn't work anymore, When setting up my camera, i setup the position and then i put in the face object sexp, in this case i want it to look at the halkins so i select it. Test the mission and the camera doesnt face the halkins it instead looks at the direction the halkins is facing. I then had to add in the camera rotation and change the heading a 180 degrees for the camera to face the freighter. I have looked at previous cutscenes sexps i have made in the past i all i ever seemed to use was the camera facing object and it faced the object. Is it the version of Fred i am using? i am using 3.7.2 RC5 does this version have issues with the cutscene SEXPs?

Can anyone helps before i tear out the last of my hair in trying to get it to work?
Title: Re: How to make a camera track a ship?
Post by: Axem on March 29, 2015, 09:24:38 am
The thing with set-camera-target is you need to make sure your camera orientation is at 0,0,0. Basically the sexp makes the camera's zero orientation become a vector that always points at the target.

My advanced cutscene reference should help you out if you have other issues with the sexps! (They are very idiosyncratic...)

http://www.hard-light.net/wiki/index.php/Advanced_Cutscene_SEXP_Reference
Title: Re: How to make a camera track a ship?
Post by: starbug on March 29, 2015, 10:23:27 am
ah cool, cheers Axem will have a look
Title: Re: How to make a camera track a ship?
Post by: procdrone on March 29, 2015, 12:56:50 pm
Keep in mind that the set-camera-target is very strange It works bit illogical, but that's how it works.

When you set the target, the said target coordinates are always 0,0,0 for the camera, and it follows that point. BUT, if you use set-camera-facing, with whatever arguments, that 0,0,0 coordinate is modified by the coordinates you used with camera facing.

For example, your station have coordinates 6000,0,4000 and you set it on target. After using set camera facing on a object with coordinates 6000,500,4000... the camera will be pointing at the point 6000+6000,0+500,4000+4000... which ends up with 12000,500,4000 unrelative. Totaly away from the point you wanted eh?

That explenation might be a bit on the nose, but ALWAYS use camera-reset (remember to add argument true) before using the set-camera-target, just dump in the place where the camera is supposed to be positioned, and set the target. If you want to drop the idea of following camera, just restart it again, and dump in new coordinates.


....hope it helps