Adding camera animations in missions

Prerequisites

To be able to create new camera animations and add them in mission scripts you first have to know how to create new missions. Here are 2 articles to help you with this:

Create the camera animation

First, you have to open the World editor and create or open a primitive (the camera animation and the mission that refers to it must be in the same primitive).

Now, to create a new camera animation you must create a camera_animation_editor . This node can contain several camera animations.
So do a right click on your primitive and click: Add_camera_animation_editor

As I said, a camera_animation_editor node can contain several camera animations. These animations are defined by a camera_animation_tree node that you can create by doing a right click on your camera_animation_editor and clicking on: Add_camera_animation_tree

Double click on the newly created camera animation tree and set its name to the name you want your camera animation to have. This name will be used in the mission script to refer to this camera animation.
Say we named our camera animation MY_CAMERA_ANIMATION

Now that we have a new camera animation we have to add it some steps to tell it how it should move. Do a right click on the camera_animation_treenode and choose the type of movement you want. You can add as many steps as you wish. They will be executed one after the other, keeping the order they have in the camera_animation_tree node.

As you can see, there are several types of movements. I will explain what they do, and what are their parameters:

Static

The static movement is a movement that does not change the position of the camera but only (if you want) the point it's looking at.

The parameters are:

Go to

This movement goes to a specified position (or entity) during the specified duration.

The parameters are:

Follow entity

This movement follows an entity during the specified duration.

The parameters are:

Turn around

This movement turns around a point or an entity during the specified duration and with the specified speed.

The parameters are:

Return

This movement returns to the starting position during the specified duration.

The parameters are:

Now that we have added movements to our camera animation, we can add for each movement a sound trigger (action that plays a sound) and/or camera modifiers. Do a right click on the movement for which you want to add a sound trigger and/or a camera modifier and choose what you want to add.

For the moment there is only the shake camera modifier which is a modifier that shakes the camera during the movement. Its parameter is the strength of the shake.

Here is an example of a camera animation:

Add the camera animation to the mission

Now that we've created our camera animation called MY_CAMERA_ANIMATION we have to add it in a mission as a pre action and/or a post action. To do so, just create or open a mission and do a right click on the pre_actions or post_actions node. Then you can choose: Add_camera_animation to add a camera animation.

Note that you can also add sound triggers in mission actions.

Finally, double click on the camera_animation you just created and set the animation_name parameter to the name of the camera animation you created earlier. In my case it was MY_CAMERA_ANIMATION

You can now compile the mission to generate the mission script and you're done ! The camera animation will be played during the mission pre_actionsor post_actions depending of what you specified.