Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Deckard on April 09, 2008, 02:25:06 pm

Title: Cinematics SEXPs request
Post by: Deckard on April 09, 2008, 02:25:06 pm

 The following 3 SEXPs would be much appretiated:

 1.- Camera Zoom out

 2.- Camera Zoom in

 3.- (Extended) Camera shrudder for the very camera view ( and not only for the HUD view )


 Thanks for your time,
Title: Re: Cinematics SEXPs request
Post by: Mobius on April 09, 2008, 02:28:57 pm
:welcomesilver:

Yeah, you're right, but you can get those effects with tricks. For example, you can use every-time and coordinate manipulation in conjunction with a camera model to move the camera and represent a nice zoom effect ;)
Title: Re: Cinematics SEXPs request
Post by: Goober5000 on April 09, 2008, 05:55:26 pm
Look in the "cutscene" subcategory of sexps.

1) set-fov

2) set-fov

3) set-camera-shudder
Title: Re: Cinematics SEXPs request
Post by: Mobius on April 10, 2008, 10:40:12 am
But set-fov is sudden, not progressive...
Title: Re: Cinematics SEXPs request
Post by: Ransom on April 10, 2008, 12:43:57 pm
We really need a way to move the camera around smoothly. Using every-time is a temporary solution but since SEXPs can't use decimals it gives jittery results at best.
Title: Re: Cinematics SEXPs request
Post by: Mustang19 on April 10, 2008, 01:17:26 pm
Tying the camera to an object by using every-time/set-object-position and using the object as a "camera plane" has given me good, smooth results. You just need to make sure that the object is invisible so the model doesn't get in the way of your view.

I need to make a Wiki page on this. This subject keeps coming up.
Title: Re: Cinematics SEXPs request
Post by: Ransom on April 10, 2008, 01:35:04 pm
I don't agree. That's exactly the method I was referring to, and I don't think it's smooth enough. If the object you've tied the camera to is going less than about 30 m/s, you can clearly see the wonky movement. It makes precise shots look awfully hackish.
Title: Re: Cinematics SEXPs request
Post by: blowfish on April 10, 2008, 01:39:00 pm
IIRC WMCoolmon recently submitted some camera code that allowed the camera to be translated over a period of time, with acceleration (among other things).  I don't think it has been added to SEXPs though.
Title: Re: Cinematics SEXPs request
Post by: WMCoolmon on April 19, 2008, 02:47:44 am
Yeah, I added it to the unstable branch of SVN, but the unstable branch was too different from the stable branch to easily port it over.

It uses a three-part acceleration-constant velocity-deceleration movement curve based on Newtonian motion of an object under constant force. Meaning that you get something looking like this (http://fs2source.warpcore.org/temp/wmc/camera_curve.gif), applied independently for x, y, and z rotation, as well as pitch, bank, and heading, or even zoom. Gives a nice smooth-looking movement, and the entire movement equation is set up as a separate function so it could easily be used for other things as well (although it's a hefty bit of logic, probably not as much as most matrix calculations though.)

It also lets you lock the camera to a specific object or lock the camera to face a specific object, and then the programmed movement is added on to the camera's position/facing based on those. Finally, it also takes into account custom position/orientation functions, which is not all that far from adding per-camera scripting hooks for movement.
Title: Re: Cinematics SEXPs request
Post by: Ransom on April 19, 2008, 05:47:40 am
That's seriously awesome, WMC. Can't wait to see this in a build.
Title: Re: Cinematics SEXPs request
Post by: Goober5000 on April 19, 2008, 12:35:24 pm
Very nice.  I had been thinking of adding some code where the camera could be translated along a parametric curve.  Yours looks like it can do that, and more.
Title: Re: Cinematics SEXPs request
Post by: Deckard on April 19, 2008, 10:07:29 pm
Great news ! ;) .

PS: The set-camera-shudder SEXp seems to be working for the HUD perspective only.
Title: Re: Cinematics SEXPs request
Post by: Mobius on April 20, 2008, 02:55:19 am
Are regular builds going to be implemented with the new feature?
Title: Re: Cinematics SEXPs request
Post by: Deckard on April 23, 2008, 02:41:07 pm
I got another SEXp request.

Running certain cinematics I've been making for the BTRL game, I can't not turn off the player engines SFX via FRED2, which many times breaks the immersion factor during these cinematics..

So, would be possible to code a new SEXp to turn on/off the engines'SFX?

Thanks in advance,
Title: Re: Cinematics SEXPs request
Post by: KeldorKatarn on April 24, 2008, 03:25:53 am
For smooth movement try binding the camera to a ghost ship and have that one move with set-object-speed.
Title: Re: Cinematics SEXPs request
Post by: Ransom on April 24, 2008, 07:47:12 am
I'm pretty sure that won't solve the problem.

The movement isn't smooth with the binding method because SEXPs can't use decimals. So a camera-plane coordinate of X 12.3 will be translated by set-camera-position to 12, which means the camera will only move between whole numbers. The result is jerky camera movement at speeds below ~30 m/s, and higher if you're moving diagonally.