The intro camera allows you to make sweeping shots of your scenario or map upon loading.
Using a camera in this way can be an effective way to cinematically introduce a custom scenario to establish a scene and familiarize the player with the terrain.
Setting up a camera consists of two main steps:
- Create a Spline for the camera to follow.
- Set up a Script to make the camera follow that spline.
This guide covers the steps required to perform these two main steps to set up an intro/outtro camera.
Setting up the Spline in the Editor
The first step to setting up an intro/outro camera is to define the path that the camera will take.
This involves setting up a Spline which the camera will follow along its path.
To create a camera spline, perform the following steps:
Phase 1: Create the File Structure
First, you need to create a folder for "swoopy" cams.
Follow the steps below.
- In the Scenario Tree, Right-Click on Scenario and click +Add..
- The New Layer window will then appear. Give the folder a Name relevant to your camera. Also make sure the "Set As Default Parent" box is NOT checked.
- Press OK. Your file structure for your camera will be created and added to the scenario tree.
Phase 2: Create a Spline
Second, you need to create a spline. There are two different ways to create a spline.
The easiest one is covered first, with the optional method covered afterwards. Either of these methods will work for creating a spline.
Primary Method: Use the Object Browser
The default way of creating a spline is by using the object browser.
- Go to the Object Browser and select the Spline object. Then drag it to the Render View to place it in the map.
- A spline will then be created in the Scenario Tree. Left-Click and Drag this spline into the intro/outro camera folder you created in Phase 1.
Secondary Method: Use the Folder
- Select your folder in the file structure you created in Phase 1, Right-Click it and press +Add...
- This will open up the Add Blueprint window. Select Spline and press OK.
- The new camera spline will then appear in the Scenario Tree underneath your folder.
Phase 3: Prepare your Spline for the Camera
Third, you need to add components to your spline to make it work with the scripting tools.
Follow the steps below to prepare your spline for the camera.
Steps must be completed IN ORDER for the spline to function as desired.
- Select the spline in the folder structure, Right-Click it, and press +Add...
- The Add Blueprint window will then open. Select Instance Component and press OK.
- An Instance Component will then be created in the Scenario Tree. Right-Click this component and press +Add...
- The Add Blueprint window will then open. Select Scar Marker and press OK.
- A Scar Marker will then appear in the Scenario Tree. Select it and press +Add...
- The Add Blueprint window will then open. Select Proximity Circle Component and press OK. A new Proximity Circle Component will then be created in the Scenario Tree.
- In the Scenario Tree, select the Proximity Circle Component to access its Properties panel.
- In the component's Properties panel, make the following changes:
- Adjust the Radius property to "1."
- Use the Name field to give a name to your marker. Relic names markers with the prefix "mkr_" to easily recognize them.
- Set the Type drop-down menu to Camera.
- Now your spline should now appear like the example below.
- You can now select the individual nodes of the spline and move them to where you want, forming the path the camera will travel along. If needed, you can add or remove control points from the spline to sculpt its path. See the Spline guide for instructions on modifying spline control points.
Phase 4: Add a Marker to the Map where the Camera Will Look
Forth, you must select the location the camera will look after it has finished following the spline.
To define this point, follow the steps below:
- From the Object Browser, find the Scar Marker and drop it onto the map.
- A panel will then open labelled Scar Marker Name and Type. Using this panel, add a Name for the marker and set the Type to "Camera."
- The camera will now look at this direction after following the spline path.
Setting up the Script
The second part of creating an intro/outro camera involves setting up the script to run.
This will execute the camera event upon mission start and/or end.
Step 1: Create an .event file
- Select your .scenario file click the Edit Events button found in the toolbar.
- A .events file with the same name as your mod will then be created.
Step 2: Edit the .events Script File
- Rename the Intro Function to whatever you prefer. Be sure to keep the structure intact starting with: "EVENTS_[nameofevents]"
- Add Functions to the .events file to activate the camera spline during the intro.
These functions include the following:
- This function will fade the screen to black immediately.
- First Parameter: FADE_OUT to make the screen go dark, FADE_IN to make the screen come back to normal.
- Second parameter: time it takes to complete the action.
- This function will move the camera to this marker at the end of the spline.
- Util_EnableCardinalCinematicMode(true, CAM_INTRO):
- This function will start/stop the cinematic mode for the camera and wont allow the player to interact with the map.
- First parameter: "true" to start, "false" to stop
- Second parameter: CAM_INTRO for intro cameras and CAM_OUTRO for outro camera at the end of a mission.
- Camera_LinearSplinePanOverTime( AllMarkers_FromName("markername", ""), int panTime, bool keepPanQueue, bool controlRotation)
- This function will execute the spline.
- First parameter: name of the marker
- Second parameter: time it takes for the spline to complete
- Other parameters should be set to false.
After these changes, the script should look something like the example below. Note that in this example the mission Title Card shows up, an extra delay has been added, and an audio file will begin playing with the game waiting for it to finish before giving control back to the player.
Step 3: Add the Event Intro and Outro to the Main Scar File
- Open the main .scar file for your scenario.
- In the Recipe area, define which events need to start at the beginning of the scenario and what needs to play at the end.
- Add the line "introNIS = " followed by the name of the function where your camera intro is specified.
- Add the line "outroNIS = " followed by the name of the function that needs to start when the scenario is completed. If you do not have an outro, this is not needed.
When you are finished, your script should resemble the example below.
Step 4: Test your Scenario
Now you are ready to Build your mod and try the camera out.