Making In-Game Movies

In order to make in-game movies you must make a level where everything is self-running and the camera moves about on its own. Some special things are required to make this happen.

Actors

The actors in the movie are Pawns, scripted to carry out the actions you wish and responding to various triggers set and reset by other entities and Pawns. See the document on scripting Pawns to see how this is done.

Cameras

In order to move cameras around the level and switch between them you must set, in the PlayerSetup entity, LevelView to 3 (Fixed Camera mode). Cameras that are to move can be attached to specially setup Pawns, which then can be scripted to move along a path of ScriptPoints. A good Pawn type to use for moving cameras would be defined in Pawn.ini as

[MovingCamera]
actorname = proj.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = false
boundingboxanimation = nocollide
shadowsize = 0

It would be invisible and have no bounding box to affect collisions. When attaching the FixedCamera entity to one of these Pawns leave the BoneName blank and it will attach to the root bone at the center of the actor. The camera will follow the movement and rotation of the Pawn as it steps through its script.

The first camera to be used when the level starts should have its UseFirst entry set to true. No other camera should have this flag set to true.

Switching Cameras

By setting up the Pawns and attached cameras correctly you can make it easy to switch between them. A Pawn that is not yet being used should have as its SpawnOrder something like this:

Start2[()
{
AddTriggerOrder("Camera2", "eventstart2", 0);
}]

This makes the Pawn wait for a trigger called 'eventstart2' to go on. When it does it will run the Order called 'Camera2'. The attached FixedCamera should have its triggers set this way:

TriggerName eventstart2
ForceTrigger eventstart2

This will cause the Pawn and attached camera to be activated at the same time. When you wish to switch to another camera use these actions in the Pawn's script:

SetEventState("eventstart2", false);
SetEventState("eventstart3", true);

This will deactivate the current FixedCamera and start up some other Pawn and camera that is waiting for the trigger 'eventstart3' to go on.

Exiting the Movie

When the movie is about to be ended and you are switching to another level for the user to play, you must do certain things. One of the Pawns, either an actor or a camera mover, must set a trigger to on when the movie is to end by running the following in its script:

SetEventState("movieend", true);

The name of the trigger, called 'movieend' here, can be any thing you wish. Add a LogicGate entity to the level with its entries set as follows:

szEntityName EndMovie
Trigger1Name movieend
Trigger2Name MovieMode
Type 3

Then add your ChangeLevel entity and set

TriggerChange EndMovie

Lastly, in the PlayerSetup entity, set the entry MovieMode to true. This will cause a level change when the script reaches the end or when the user presses the ESC key.