Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Flipside on March 20, 2007, 09:27:07 pm

Title: Cutscene camera thingy/discussion
Post by: Flipside on March 20, 2007, 09:27:07 pm
Ok, I'm trying this more for experimentation than an actual goal, but I tried setting up a sexp which basically went :-

Code: [Select]
every-time
     true
     set-camera-position
     getobjectx(Object camera following)
     +
          getobjecty(Object camera is following)
          5
     -
          getobjectz(Object camera is following)
          20
every-time
     true
     set-camera-facing
          Target Object

This should make the camera constantly adopt a position 20 metres behind and 5 metres above the object and look at a seperate object, causing a 'flyby' type effect if you set it up correctly.

I've noticed a couple of problems though. The first is that the camera looks like it's in the wrong spot, but that may be just down to me misreading or misinterpreting co-ords somewhere.

The second is that whatever ship you are following, when it is in view, tends to 'stutter' as it moves.

Has anyone else tried something like this and had any more success? It looks pretty good as it is, if it weren't for that stutter, I've tried moving the camera so that it is quite some distance from the ship, but the debris still stutters around.

I suppose what would be really handy is a 'camera_trail' sexp, which would make the camera be 'pulled' along by the target in a similar manner to nebula trails, so there's a slight delay in reaction time.

I recall Turey asking about this once before, but I'm not sure whether he had any luck getting an answer.
Title: Re: Cutscene camera thingy/discussion
Post by: CP5670 on March 21, 2007, 02:24:00 am
Moving cameras aren't really possible at the moment. There is a slight delay between when the camera sexp fires and the camera is actually moved, which leads to the stutter. You can instead put the player ship under AI control, change it into something with zero accel/decel times and have it follow a waypoint at the same speed as the moving ship. It obviously has to be facing the direction it's moving in (somewhere around the back of the ship), but that is currently about the best you can do.
Title: Re: Cutscene camera thingy/discussion
Post by: Flipside on March 21, 2007, 03:09:30 pm
Yeah, I had a feeling it was to do with camera update. Ah well, thank for the hint, I'll give that a go :)
Title: Re: Cutscene camera thingy/discussion
Post by: Turey on March 21, 2007, 06:41:55 pm
I recall Turey asking about this once before, but I'm not sure whether he had any luck getting an answer.

Not a satisfactory one. The camera simply doesn't update fast enough for any sort of constant movement.

Now, if it'd update every frame instead of every second...  :drevil:
Title: Re: Cutscene camera thingy/discussion
Post by: takashi on April 12, 2007, 06:02:46 pm
such a feuture would allow me to perfect several cutscene missions i have in the works.