Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Skullar on November 07, 2008, 08:50:32 am
-
Postet it at home ( TBP ), was asked to post it here :
TBP FREDDING TUTORIAL
How to do cutscenes
Introduction :
If you want to make cool cutscenes, you have to have some experience with FRED already, otherwise it may be difficult to arrange certain effects....
1. DEFAULT knowledge
For cutscene art it is important to know a few traits of FRED, the editor. First of all, the order of the entries in a SEXP matters. They are carried out one after another.
So, for example, if you let the camera look at an object and then change camera position, you will get other results as if you had set camera position BEFORE letting it look at an object.
Second.... The mission itself continues and is not interrupted or paused in any way. When a cutscene is shown, the player's ship can still be shot and destroyed, which means you have to take precautions this does not happen if you let a cutscene play. There are other SEXPS granting the player's ship AI-control and invulnerability. These have to be used as well, nothing is as stupid as being shot while being forced to look a cutscene.
These are the most important SEXPS :
set camera position
This SEXPS positions the camera at a place in the 3-dimensional space. You will have to state x, y and z coordinates.
This SEXP also starts a cutscene. If a cutscene is already running, it only changes camera position.
A set camera position SEXP could look like this :
(-) Set camera position 1
- when
- has time elapsed
25
- set camera position
35
0
400
This SEXP sets camera in position ( 35 / 0 / 400 ) after 25 seconds playtime.
set camera facing ( object )
This SEXPS defines the place ( or the object ) the camera is looking at. In addition, the sexp lets you define the time for the camera angle to change. So, if your camera is in position and "looks around", this is the SEXP to use for the effect. This SEXP also starts a cutscene, camera position will be where it was last time. If camera position has not been stated yet, it will be ( 0 / 0 / 0 )
reset camera
This SEXP ends the cutscene and takes you back in your cockpit. If you have put the player's ship under AI control, don't forget to deactivate. A typical SEXP to end cutscene could look like that :
( - ) End Cutscene and take player back to cockpit
- when
- has time elapsed
40
- player-not-use-AI
- unlock-primaries
Alpha
- reset camera
show subtitle
This SEXP lets you show subtitles on the screen. They nicely add to the atmosphere when used properly.
Commonly, the subtitles are .tga pictures stored in the /data/maps folder.
In older builds, you have to enable tga/jpg textures in the launcher, otherwise they don't show up.
If you look up the SEXP in fred, it is pretty self-explaining. If you have seen EACW examples, they are done like that :
( - ) Show Sub1.tga as subtitle
- When
- has time elapsed
4
- show subtitle
0
600
4000
sub1
1000
true
The "true" entry at the end of the list applies to the center-horizontally tag and makes fred ignore the "0" for x coords at beginning of the list.
The y coord of 600 places the subtitle somewhere near the bottom of the screen, if resolution is set to 1024 * 768
This may cause problems when playing 640*480, but we ignore that for now.
The third line of the subtitle SEXP is empty. If you state something here, it will be shown as text in addition to the sub1.tga, which would look rather silly.
We don't need any txt, self-made .tga files are much more beautiful ;)
The other entries mean the subtitle is shown for 4000 milliseconds and takes an additional second to fade in and later to fade out.
2. FRED knowhow
Unless you are a really talented artist, things don't always look ingame as good as you thought they would.
You will have to make many changes in FRED here and there, and you will always have to check them again and again ingame, until you are satisfied with the results.
For this, it is wise to let FS2 run in windowed mode. You can easily switch between fred and the game. Just make changes to the mission in Fred, save them, then just restart the mission ingame and you an instantly see what you have changed.
In order to get the timing right and to find really nice camera positions and angles, it is easier to use the SEXPs in this way :
Use WAYPOINTS in Fred to mark positions in 3d space. Eventually TARGETS do also work, but I am fine with WAYPOINTS.
Example :
If you want the camera in a special place, then
- place a waypoint
- name it ( for example CAM1 )
- do the SEXP this way :
( - ) Set camera to Postion 1
- when
- has time elapsed
15
- set-camera-position
- getobjectx
CAM1
- getobjecty
CAM1
- getobjectz
CAM1
This way, if you play around with camera positions and stuff, you just have to drag around the waypoint in 3d space, that’s much easier than typing in coords in the SEXP itself.
You can also use the waypoint trick to let the camera look into your desired directions. For example, place a second waypoint ( CAM2 ) somewhere and do it like this :
( - ) Face Camera position 2
- When
- has time elapsed
15
- set camera facing object
CAM2
Easy, isnt it ?
Sometimes, you will want to let the camera follow an object in motion. For example, you want it to stay focused on the player for 10 seconds. In my experience I have had no problems doing it THIS way :
( - ) Cam follows player
- Every time
- AND
- has time elapsed
15
- NOT
- has time elapsed
25
- set camera facing object
Alpha 1
Here we use the EVERY TIME expression, because the camera angle has to be updated continuously to a new position.
!!!!! WARNING !!!!!
[/color]
Do not use waypoint paths in any way !! The cutscene SEXPs do not discriminate waypoints belonging to a path and cannot utilize them, they do only use the FIRST waypoint of the entire path. So, for cutscenes, use standalone-waypoints only. I put a warning here coz if you try to use path and it doesnt work, you might accidentally **** up things when trying to delete non-functional waypoints..
A BUG :
So far, there is a bug that has not been solved yet. You cannot set camera position DIRECTLY at beginning of a mission.
So, a "when has time elapsed 0 -> set camera position" SEXP does not work..
However, you can bypass the bug using an every-time expression :
( - ) Set cam position 1 at beginning of mission
- Every time
- AND
- has time elapsed
0
- NOT
- has time elapsed
1
- set camera position
getobjectx
CAM1
getobjecty
CAM1
getobjectz
CAM1
That is not very elegant, but at least it works.
Arranging Stuff.
Even though you may be able to handle the camera, you might have some problems with not having a beautiful setting to look at.
To solve this problem, you will want to look at the SET-OBJECT-POSITION Sexp
Actually, if you do it with a cutscene, you don't get "jumpy" effects.
Especially fighters and smaller vessels can easily change position, you do it the same way you set camera position, only with the SET OBJECT POSITION SEXP.
A problem can be larger objects like capital ships and stations. One way to do it is to place a new ship or station on the screen, and when you are satisfied with positioning, you can change the object type to TARGET. You cannot change to waypoint, so we use TARGET. targets are also immaterial.
Yet another method to arrange cutscenes is to place doubles of all vessels somewhere in 3d-space. Make the cutscene, and use the SHIP-VANISH SEXP to let em disappear at its end.
No one will notice you have been looking at doubles, and the original ships are still where they used to be.
FADE IN and FADE OUT
Although you will find the fade SEXPs easy to understand, there is a minor thing you have to pay attention to :
You can only fade in after you faded out. So, if you, for example, want to fade in from black at beginning of mission, you have to fade out before. This fade out has to be instantenious, for example :
( - ) Fade in at mission start
- when
- has time elapsed
0
- fade out
0
- fade in
3000
This creates a nice fade-in effect from black.
3. Advanced stuff with post 3.4b releases
Advanced SET CAMERA POSITION SEXP.
The new SEXP-camera position SEXP allows cannot only simply place the camera in a new position, it allows you to let it smoothly move to this point, starting from its last whereabout. The transit time is to be noted after the three coordinates. In addition, you can specify time used for accelerating camera and for decelerating...
Example
( - ) Camera moves to new position
- when
- has time elapsed
10
- set camera position
- getobjextx
cam1
- getobjecty
cam1
- getobjectz
cam1
10000
1000
5000
This SEXP lets the camera travel to waypoint CAM1 . after 10 seconds playtime. The camera takes a total of 10000 miliseconds ( = 10 seconds ) for this way, accelerating rather quickly at beginning and coming to a smooth standstill.
Without acceleration and decelertation time the camera moves with a constant speed all the time.
Fancy stuff
The POV SEXP allows to change the POV setting. The POV setting defines the size of the area that is in view when looking in a direction. The larger the POV setting, the more of your surrounding may be still inside the screen.
Changing POV is a rare element of dramatization when looking at one object ( seen in the episode SEVERED DREAMS, when Sheridan hears from Hiroshi of the Earthgov fleet heading to arrest him, and the camera seems to blend out his surrounding )
You may experiment with this SEXP, but it is not vital for most cutsenes.
Camera Shudder and rotation
Those SEXPS are yet premature, as they cannot be used to any effect right now. The camera rotation SEXP still is far from beeing easily applied, and does not allow for nice effects like rotating the camera around its own z-axis. Yet.
Camera shudder is only for first person view so far, and cannot be employed for cutscenes yet.
As of now, there is no more to say about the technical side of cutscenes.
4. Cutscening Art
Cutscene Art is done step by step. You start with the common triggers to set camera position, with WHEN ( or with EVERY TIME at beginning of mission )
Then you employ a set of SET-CAMERA-POSITION and SET-CAMERA-FACING-OBJECT SEXPs, after you placed some waypoints in 3d space.
To prevent confusion, you should stick to some naming conventions.
- Name all waypoints having to do with the camera cam1, cam2, cam3, cam4...
- Name models that shall only appear in cutscenes accordingly, for example Alpha1_double, Agrippa_double, etc....
- Same goes for waypoints that are coordinates for change-object-position SEXP....
When watching a cutscene, you may still hear your own annoying engine sound all the time. Especially when a cutscene is on the calm side, this may be a problem.
The solution is : The player ship should have the only goal to play dead.
If your cutscene shall feature yourself flying around, use a double.
The rest is just experience and feeling...
Greetings and have fun
Skullar
-
Wiki'd. (http://www.hard-light.net/wiki/index.php/Tutorial_-_Cutscenes)
-
Excellent Work there. Will help out a lot of people (including me)
-
Here's an old thing from me:
I will post here some ideas about in-mission cutscenes...I will edit the first post when needed...
TAKE OFF:
set camera position
Near the fighterbay. Optimal distance is 400 meters for destroyers, 800 meters or more for carriers.
set camera facing
The coords of the fighterbay, slightly modified if you want(the camera should point to the fighters when they appear, not the hangar. The fighters should appear on the screen as much as possible).
Once the fighters are launched...
every-time
and
has arrived delay
0
Wing
not
has arrived delay
8 <---one or two secs before the wing departs...this is an example...
set camera facing object
Wing
That is all. The camera will follow the wing until it departs. However, the fighters could not belong to the same class, so the camera might not follow the fighter we want...I came out with something interesting...
It is used in Steadfast Ep1 m1...
First of all, we have to create some string variables and some events...
In Steadfast you're Beta 1, so:
Beta1Fighter GTF Vesuvius name of the variable and default value.
Then we creater a variable for each member of Beta wing...
We create four(number of fighters in the wing...in this example) events:
when-argument
any-of
GTF Vesuvius
GTF Menelaos
GTF Archon
GTF Ares
EAF Claymore
is-ship-class
<argument>
Beta 1
change-ship-class
<argument>
Wing 1 <----all fighters in all wings, the ones that represent Beta 1(taking off, landing, in-mission cutscenes)will be of the same ship class of the fighter chosen by the player
Wing2 1
Wing3 1 <---third Wing, first fighter. It has not to be confused with Wing 3, the fighter that represents Beta 3 in the taking off wing.
ecc.
modify-variable
Beta1Fighter(GTF Vesuvius)
<argument>
And then we repeat the procedure with the 3 other members of Beta wing.
The fastest fighter selectable is the EAF Claymore. We create another event and another variable...
when-argument
any-of
Beta1Fighter
Beta2Fighter
Beta3Fighter
Beta4Fighter
string-equals
<argument>
EAF Claymore
modify-variable
FastestFighter(GTF Vesuvius)
<argument>
The Menelaos and the Vesuvius are equal in speed...
when-argument
any-of
Beta1Fighter
Beta2Fighter
Beta3Fighter
Beta4Fighter
and
string-equals
<argument>
GTF Vesuvius
not
string-equals
<argument>
EAF Claymore
not Using or should be more appropriate, since the Vesuvius and the Menelaos are the same
string-equals
<argument>
GTF Menelaos
modify-variable
FastestFighter(GTF Vesuvius)
<argument>
And so on until we have created events for all the ship classes.
Create another string variable, FastestOfBeta(Wing)
when-argument
any-of
Wing 1 the four fighters that take off
Wing 2
Wing 3
Wing 4
is-ship-class
FastestFighter(GTF Vesuvius)
<argument>
modify-variable
FastestOfBeta(Wing)
<argument>
Then we return back to the starting events, and replace:
set-camera-facing-object
FastestOfBeta(Wing)
-
Nice job!
IIRC, there was another way to move the camera:
every-time
has time elapsed
2
set camera position
getobjectx
ship1
getobjecty
ship1
getobjectz
ship1
using this creates a sort of on-board camera.
of course you have to give a precise waypoint path (better to use A LOT of waypoints to have smooth maneuvres) and precise orders to the "ship1" ship; if it is a capital the cap-waypoint-speed may also be used with good results.
that SEXP might be useful if you want to follow a fighter/bomber during an attack run; in this case however you need to add a "+" operator and some 30/50 metres per each axis (otherwise the camera remains INSIDE the fighter...not really a nice view). of course you'll need to use also an appropriate "set camera facing object" SEXP.
the same sexp is also nice if the "ship1" is invisible... in this way it is possible to create a camera which moves as you want!
-
There indeed are invisible models to be used in cutscenes. You can still use a visible ship if it's far enough and/or if the cutscene displays a lot of them at the same time. :)
-
I really like this overview :)
I made a long cutscene-mission some time ago (before the moving camera worked) and had several workarounds with every-time that went as far as producing some kind of in timer doing ~ 25 ticks per second for changing camera position variables...
But using every-time with set camera position on slow moving objects like cruisers makes the camera jump forward only every 10 frames or more what looks odd.