Cinematics Tutorial, Part 1
Intros, Outros, Cutscenes. These are the "candy" of mission making, yet they can often make or break a mission. Done properly, a good cinematic stages the mission, introduces the mission plot, provides tension, or tension-relief. A good mission can be made great by creative cinematics, but it can also be ruined by a poorly made cinematic.
There are two broad ways to create a cinematic. The first is purely within the Editor, using Waypoints, Triggers and Logic Units. The second is through scripting. Personally, i much prefer to script things in missions, so this tutorial will only cover scripting cinematics. What's the difference? Scripting cinematics is longer, more time consuming, and requires a better understanding of OFP. The benfits are a much more powerful and accurate determining of how things are meant to work. Scripting gives you the knowledge of how to make things happen EXACTLY as you want them to happen, every time. Kind of obvious that i like scripting OFP isn't it :)

Seriously though, I find scripting works better for me. If you prefer to use the first method mentioned above, more power to you. It's a personal choice, and you have to go with whatever works for you best.

And while i've still got your attention, let's get a couple of things out of the way.
Hi, I'm Hangfyre. I'm the Senior Mission reviewer for www.opflashpoint.org, and Ive personally reviewed ( at last count ) over 500 missions. My point here is that I've seen the best and worst of cinematics. What follows in the Guidelines to cinematic lengths and what makes a good / bad Cinematic are my personal opinion. I do not claim to be the foremost expert in cinematics, but I have had a shitload of experience with them. If you disagree with me, great :). The Guidelines are just that, guides. It's a matter of personal prefernce as to how, what, and how long cinematics are. End of sermon [grin]

Here's a rough idea of what this tutorial contains :
1.Definition of Terms, such as Intro, Outro, Cutscene, Cinematic
2. Guidelines for the length of Cinematics
3. What makes a good / bad cinematic
4. Basic Commands used in Cinematics, including examples


Definition of Terms


Hmm, just so there's no mis-understandings, lets get a few terms defined properly.

Intro = The Introduction. This can start either before or after the Briefing screen
Outro = The End. Happens after the mission is finished, and can happen if the mission is won and/or lost
Cutscene = Any cinematics that happen during the mission itself.
Cinematics = All the above, collectively and separately.

So when i'm referring to "Cinematics", i'm talking about Intros and Outros and Cutscenes.

Guidelines for the length of Cinematics


Now, unless you are main-lining Steven Spielberg, or are Stanley Kubrick re-incarnated, the shorter the cinematic the better. Overly long Intros ( espicially in Multiplayer missions ) are a total turn-off for players. As a rough guideline, here's my opinion as to the various lengths of cinematics

Single Player Missions
Intro - 3 minutes max
Outro - 1 minute max
Cutscenes - 10 seconds, and only when theres no chance of the player dying while watching the cutscene

Multi Player Non-Coop Missions
Intro - 30 seconds max
Outro - 1 minute max
Cutscenes - Never, unless theres a damn good reason.

Multi Player Coop Missions
Intro - 1 minute max
Outro - 1 minute max
Cutscenes - 10 seconds, and only when theres no chance of any of the players dying while watching the cutscene

What makes a good / bad cinematic


Following right on from the length of cinematics, is the content. A good cinematic can improve a mission no end, but a bad cinematic can have people exiting damn quickly. Conversely, an excellent cinematic, not matter how brilliant, can make a bad mission good. As such, make your mission FIRST. The cinematics can be added afterwards, and compliment the mission. Besides, once you have finished the mission, you generally have a much better idea of what the various cinematics will be. There's no point making a beautiful Intro featuring dogfighting A-10's and Sukhoi's if the mission is a Black-ops sneak-in-and-assassinate-the-leader !.

So then, what does make a good / bad cinematic? Content, Lighting, Camera movement, camera speed, and on and on...
There's really no limit to things i could say here. What it comes down to though, is this. Watch your favourite War/Action/Military-based movie. Look at the way the camera is used. Look at what the camera is focussing on during action scenes. Your best source of what is good for a cinematic is what you like/enjoy in movies.

Now, I freely admit that it's damn difficult, nearly impossible to get the same "look" of a movie in OFP. There's a definite limit to how much you can do with OFP's soldiers and vehicles. Hell, it's hard enough at times to get the #$&#* ing soldiers to walk in a straight line!. And don't get me started on the whole "civilain gets out of vehicle and sligns a non-existant rifle". So you need to be realistic.

You should be aiming for smooth camera movements, decent lighting, a good mix of action and panorama. Long Intros featuring soliders walking down a road are boring, but so is a camera that jumps every second to a different view of the same object, and a jerky camera just plain looks bad.

The absolute best thing you can do is, once you've finished with your cinematic, is give it to a friend to test. Get theur feeback, and seriously listen to it. Things that you think are great may be only ok for others. Preferences and tastes vary wildly, so the more feedback you get , the better.

Like I said above, these section is really just a guide. So it boils down to this :
Make your cinematics the way you think they should be, and tweak them till you are happy. Then gets your friends to test the mission's cinematics. Get their feedback, and LISTEN TO IT.

One final thing on this subject. Addons. Again, preferences vary wildy here, from people who use them as much as possible, to people who refuse to use them. What I think is the best balance is this; Use addons if needed for the mission plot Every addon you use in your missions should be there for a specific reason. The more addons you use, the less likely people are to download and play it. This goes double for MP missions, since OFP does not support automatic downloading of addons. I'm pretty sure everyones played online at some stage, and been booted from the server because you didn't have a needed addon.

So be frugal with addons. Stick to either very popular ones, that you can be fairly sure everyone has, or else small addons, that can be included in the mission download.


Basic Commands


Ok, enough of the guidelines stuff. Let's get down to the meat of cinematic creation. The basic and advanced commands you need to know and understand.

There's only really 6 commands that are absolutely necessary in scripting cinematics. However, there are 8 commands that are the basics, and can deal with pretty much any situation you might desire.

CamCreate Creates the camera.
Syntax : [camera name] = [camera type ]CamCreate [position array]
Example : _cam = "camera" CamCreate [0,0,0]
This would create a new camera object, called "_cam", at the co-ordinates [0,0,0], which is the bottom left of the map.

CamSetTarget Assigns the camera object to focus on a target.
Syntax : [camera name] CamSetTarget [target name]
Example : _cam SetTarget westsoldier1
This would change the camera object's focus to a new target. It does not move the camera, it changes what the camera looks at.

CamSetPos Moves the camera to a new position
Syntax : [camera name] CamSetPos [position array]
Example : _cam CamSetPos [125,254,25]
This changes the location of the camera object to co-ordinates [125,254,25]. The target the camera is focussed on does not change

CamSetRelPos
Syntax : [camera name] CamSetRelPos [position array]
Example : _cam CamSetRelPos westsoldier1
This command changes the camera's relative position to the target. The position array can take positive or negative numbers. The best way to imagine the array is like this. Where you are sitting right this second, +X to your right, -X is to your left, +Y is straight ahead, -Y is straight behind, +Z is up, and -Z is down.

CamCommit
Syntax : [camera name] CamCommit [time in seconds]
Example : _cam CamCommit 5
This command is an extension of the previous two. It tells the camera object how long to take to do a CamSetPos or CamSetRelPos command

CamCommited
Syntax : CamCommited [camera name] OR @CamCommited [camera name]
Example : CamCommited _cam OR @CamCommited _cam
Both variations of this command do the same thing. They are "wait" commands. Both tell the camera object to finish the previous command before moving on to the next. The "CamCommited" allows the script iteslf to continue, whereas "@CamCommited" halts the script until the previous command is completed.

CamDestroy
Syntax : CamDestroy [camera name]
Example : CamDestroy _cam
Removes the camera object from use. Generally one of the very last commands used in a script.

CameraEffect This is a biggy. There's lots of options you can use here, but to keep it simple, there's only two versions of this command you need to worry about.
Syntax : [camera name] CameraEffect [effect,position]
Example : _cam cameraeffect ["internal", "back"] and _cam cameraeffect ["terminate", "back"]
These are the only two you honestly need. While there are more options available for this command, these two are all you need for basic scripting.

Below is a short list of the various variable names i've used above.

[camera name] is the name assigned to the camera. Generally people use _cam.
[camera type] can be "camera" or "seagull". Stick to "camera" for now.
[positon array] is the location that the camera is to be created. Standard x,y,z format.
[target name] is the name of the target of the camera. This is the name you give the unit, not the unit type
[time in seconds] is pretty obvious.
[effect,position] is only used in the "CameraEffect" command. A fuller description is given below

Example Code and Missions


How do you actually use these commands in a script? Well, it's pretty straightforward. You create the camera, give it a target to look at, change it's postion, change it's target, and then destroy it.

A simple cinematic script ( very simple ) looks like this

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camsettarget westsoldier1
_cam camsetrelpos [0,20,5]
_cam camcommit 0
@camcommitted _cam
~5
_cam camsettarget westsoldier2
_cam camsetrelpos [0,-20,5]
_cam camcommit 5
@camcommitted _cam
~2
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


Now what the hell does this do, you ask. Let's break it down, line by line.

_cam = "camera" camcreate [0,0,0] Creates a new camera, at [0,0,0], and calls it "_cam"
_cam cameraeffect ["internal", "back"] Sets the way the pitcure looks
_cam camsettarget westsoldier1 Sets the target for teh camera to focus on
_cam camsetrelpos [0,20,5] Sets the relative position of the camera to 20m in front of the target, and 5m above it.
_cam camcommit 0 Tells the camera it has 0 second to move from [0,0,0] to the westsoldier's position.
@camcommitted _cam Halts the script until the camera is in it's new position
~5 have the script wait five seconds
_cam camsettarget westsoldier2 changes the camera's target to westsoldier2
_cam camsetrelpos [0,-20,5] Sets the relative position of the camera to 20m behind of the target, and 5m above it.
_cam camcommit 5 Tells the camera it has 5 seconds to move from westsoldier1's position to westsoldier2
@camcommitted _cam halsts the script until the camera is in it's new position
~2 wait 2 seconds
_cam cameraeffect ["terminate", "back"] set the camera view back to the player
camdestroy _cam destroys the camera object
exit exits the script.

Here's a copy of the first sample mission, using this script. As you can see, the camera appears behind the westsoldier1, hangs there for 5 seconds, then moves over to westsoldier2, waits for 2 seconds, then exits.

Download Sample mission 1

take a look at the mission. Notice how the camera moves fairly quickly between the soliders. This is contolled by how you write the "_cam CamCommit" command. Longer times there mean slower camera movement between positions.
Also note how the camera stays focussed on westsoldier1 for the first half of the movement, and the quickly pivots to focus on westsoldier2 for the 2nd half. This is deleiberate, and part of the way the camera works. Whenever the camera switches targets, no matter how long you allow it to move, this pivoting effect happens.


Ok, now that was a nice simple cinematic. Only one camera movement involved, and both targets were stationary. Things get fun when you have more targets, or they are moving.

Take a look at this script

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camsettarget westsoldier1
_cam camsetrelpos [0,40,2]
_cam camcommit 0
@camcommitted _cam
~6
_cam camsettarget westvehicle1
_cam camcommit 2
@camcommitted _cam
_cam camsetrelpos [10,20,1]
_cam camcommit 2
@camcommitted _cam
~5
_cam camsettarget westsoldier2
_cam camsetrelpos [0,50,1]
_cam camcommit 5
@camcommitted _cam
~5
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


Download Sample mission 2

Only few more lines of code, but the effect you get is much nicer. You have movement, and the camera seeming to follow the HUMVEE along the road.

One thing to notice is the way the camera "jerks" up and down when focussed on the westsoldier2. The is an artifact of the way the camera works. because the soldier is walking, his height changes slightly every time he takes a step.
A previous tutorial I wrote covered this "bug" and ways to fix it,

To be brief, rather than relying on the camera focus being directly on the soldier, you can use other objects, or specific co-ordinates to acheive the same effects, without the "jerky" camera.

So let's try this same cinematic again, using some other tricks, to avoid the jerky camera.

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camsettarget block1
_cam camsetrelpos [0,40,2]
_cam camcommit 0
@camcommitted _cam
_cam camsettarget block2
_cam camcommit 6
@camcommitted _cam

_cam camsettarget westvehicle1
_cam camcommit 2
@camcommitted _cam
_cam camsetrelpos [10,20,1]
_cam camcommit 2
@camcommitted _cam
_cam camsetpos getpos block5
_cam camcommit 3
~2
_cam camsetpos [getpos _cam select 0, getpos _cam select 1, 5]
_cam camcommit 3
@camcommitted _cam
_cam camsettarget block3
_cam camsetrelpos [0,50,1]
_cam camcommit 5
@camcommitted _cam
_cam camsettarget block4
_cam camcommit 6
@camcommitted _cam
~3
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


Download Sample mission 3


Using "Invis (H)" objects ( invisible helipads ) as the target of the camera, you avoid the jerky camera totally. It takes more work to have the angles work correctly, and it doesn't focus specifically on whats on the screen, but it looks so much better. Also notice I'm now using "getpos" and "setpos" commands. These allow a much finer control over the camera, as you can specify exactly where you want ot.

Finally, for this particular section, let's try this cinematic one more time, except I'll use the co-ordinates, and setpos commands.

I'm using a simple little co-ordinate finder script, which looks like this

_pos = getpos block1
_x1 = _pos select 0
_y1 = _pos select 1
_z1 = _pos select 2
_stringpos = format["X: %1nY: %2nZ: %3n",_x1,_y1,_z1]
Hint _stringpos
~6


It shows as a hint, the X,Y,Z co-ordinates of any object you wish. Just replace the "block1" with the objects name.

So, plugging my co-ordinates in, and tweaking the commands slightly, we arrive at...

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camsettarget block1
_cam camsetpos [9572,1666.5,3.2]
_cam camcommit 0
@camcommitted _cam
_cam camsettarget block2
_cam camcommit 6
@camcommitted _cam
_cam camsettarget westvehicle1
_cam camcommit 2
@camcommitted _cam
_cam camsetpos [9558.8,1678.6,3.6]
_cam camcommit 2
@camcommitted _cam
_cam camsetpos [9530,1717,3]
_cam camcommit 3
~2
_cam camsetpos [9530,1717,5]
_cam camcommit 3
@camcommitted _cam
_cam camsettarget block3
_cam camsetrelpos [0,20,3]
_cam camcommit 5
@camcommitted _cam
_cam camsettarget block4
_cam camcommit 6
@camcommitted _cam
~5
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


Download Sample mission 4

What's the difference between version 3 and verison 4 you ask ?. Not much honestly, but it does show the different ways you can acheive the same outcome.

Alright, that covers the basics. If you work through this tutorial, you will be able to create excellent cinematics, which will complement your missions. The next tutorial will cover more advanced commands.