Repository navigation
Tutorial 3: Adding some basic events

Our mission now has a start and end, in this tutorial we'll start adding some basic events so that the mission has a bit of narrative.
In this tutorial we'll learn how to:
- Set the target of the player ship
- Display a message
- Make a ship jump out of hyperspace
A. In the mission editor open the mission you made in the previous two tutorials
B. Open the Add Event Node window, scroll down, and add the setshiptarget node. Fill in the details as follows:
Time: 2
Location: Kessel
Ship: Alpha
Target: falcon

This node will automatically select the falcon as the target for the ship Alpha (the player ship) two seconds after the previous node has run.
C. The displaymissionbriefing node is currently connected to the ifshipisactive node. Click on the ifshipisactive input and the two nodes will disconnect. You will need to redrag the true output back to the input on the ifshipisactive node after this.

D. Now connect the displaymissionbriefing to the setshiptarget node and then connect the setshiptarget to the ifshipisactive node.

You can now save your mission and play it, the falcon will now be automatically select two seconds after you start the mission.
Note: Selecting targets for the player isn't necessary but it can help orient them more quickly. You can also set the target for ai players.
A. Open the Add Event Node window, scroll down, and add the displaymessage node. Fill in the details as follows:
Time: 5
Location: Kessel
Message: YT-1300 Freighter, this is your first and final message, power down or be destroyed.

B. Connect the displaymessage node between the setshiptarget node and the ifshipisactive node.

You can now save your mission and play it. The message will be displayed five seconds after the previous node is run.
A. Go back to the displaymessage node and fill in the following details.
Audio File: Audio02
Internal File: false

B. In your file manager in Windows navigate to the following address: C:\Users\YOURWINDOWSUSERNAME\AppData\LocalLow\OGTeam\Open Galaxy\Custom Missions
C. Create a new folder with the name of your mission followed by '_audio' i.e. 'Tutorial Mission_audio'
D. Add your audio file to the folder
You can download a premade audio file here: https://file.io/APOF3egvopHC
NOTE: Your audio file should be in .wav format and should have the same name that you wrote in the node, in this case 'Audio02'.
You can now save your mission and play it. The message will now play with audio.
A. Open the Add Event Node window, scroll down, and add the loadsingleship node. Fill in the details as follows:
Time: 5
Location: Kessel x: 2000
y: 0
z: 0
xRot: 0
yRot: 0
zRot: 0
type: stardestroyer name: Corrupter
allegiance: imperial
cargo: no cargo
exiting: true
isAI: true
laser color: green

By setting exiting to true we tell the game that we want the ship to jump out of hyperspace and not just appear.
B. Now connect the node between the ifshipisactive node and the exitmission node

This means the ship will jump out of hyperspace 5 seconds before the mission ends.
You can now save your mission and play it.