TODO: Need to verify this is all accurate, up to date, and complete. Also needs to carefully describe what lines you need to have selected in the editor for it to work properly (animations, object and camera positioning, etc, are very sensitive to which line is selected)
The dialogue editor is used to create scenes with different camera angles, text and poses. It is commonly used to give context and progress the story in a level.
Write the dialogue
Create a text file in your mods Dialogues folder (../Overgrowth/Data/Dialogues) and write the dialogue in it like this.
#name "Mirage" #participants 1 say 1 "Thorn" "You there!" say 1 "Thorn" "Do you have any..[wait 0.4] water?"
- The #name "Mirage" is the name of the scene. This is given to a dialogue hotspot on so it knows which dialogue to activate.
- The #participants 1 is how many characters there are in the scene. The numbered boxes above the dialogue object are connected to spawn points to decide which character is which in this scene.
- say at the beginning of a line is used to make someone say something.
- The 1 is the ID of the participant that should say the dialogue, this decides who moves their mouth when the dialogue appears.
- "Thorn" is which name should appear for the dialogue
- The text within the quotes at the end of the line is the dialogue itself.
- The [wait 0.4] will make the dialogue text pause for 0.4 seconds before continuing to display the next text.
Save and close the file.
Set up the scene
Open up your level in the game, go to the Dialogue tab in the ribbon and click Load Dialogue. Select the dialogue file you created and click in your level to spawn it there.
There is a small box above the dialogue object that you just created. Select this object and alt-click on a character to tell the game that the participant with ID 1 is that character.
Select the box and press Edit Selected, bringing up the text of the dialogue on the screen. Use the arrow up and down keys to select what line in the scene you want to edit. Now press Toggle Recording, which creates a few more useful objects in our scene:
- Camera (with accompanying preview window)
- Torso control
- Head control
- Eye control
Move the camera to choose where the camera will be when the dialogue reaches the selected line, scale it to zoom in or out. Move the torso, head and eye controls to choose where the character's torso, head and eye should be pointing at that point. You need to scale up the torso and head controls for them to have any effect.
Press Load Pose and find the files with names that start with r_dialogue, find one that you think might fit and load it to make the character take that pose when the scene loads.
Press Preview Dialogue to test the scene. When you're happy, click Toggle Recording again to turn it off and press Save Dialogue to save your changes to the scene.
Trigger the scene
Now we have the scene set up, but we don't have anything that triggers it yet. We can use a dialogue hotspot to make that happen. So go to the Home tab and press Load Item, go to the Hotspots tab, click the Start Dialogue hotspot and click on the ground in your level. This should spawn a wireframe cube with a green sign icon in.
The dialogue will trigger when the player enters this hotspot, so place it where it will trigger when you want it to. Just make sure the player spawn is not inside of the hotspot, as that won't work when the level is restarted.
Press U with the hotspot selected and change the Dialogue property to be the same as the #name setting in the dialogue you want to trigger. If you've followed this example, that would be Mirage. If you don't want the dialogue to automatically trigger when you enter the hotspot, uncheck the "Automatic" checkbox.
Now save your level, start playing, enter the hotspot, and the dialogue should trigger!