Dialogue Editor

From Wolfire Games Wiki
Revision as of 10:18, 31 January 2018 by Silverfish (talk | contribs) (Character Position: Fixed link)
Jump to: navigation, search

This is the technical documentation for the dialogue editor. It's 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.

Before reading this article it's recommended that you read the Dialogue article to get a basic understanding of how dialogues work.

General Dialogue Functions

Set Dialogue Name

Command: #name "$"

Example: #name "chat_with_villager"

Sets the name of the current dialogue to whatever is written in $. This can be used by some other hotspots to start the dialogue.

Set Number of Participants

Command: #participants $

Example: #participants 3

Sets the number of participants in the dialogue to the number written in $.

Dialogue

Command: say # "n" "m"

Example: say 1 "Turner" "Hello, I am participant 1 in the dialogue and my name is Turner."

Makes participant # say m while the name tag shows n.

Waiting

Command: [wait $]

Example: say 1 "Turner" "Hmm... [wait 0.5]I should eat some carrots!"

Put somewhere in the middle of a say command to pause the text printing for $ seconds.

Wait For Click

Command: [wait_for_click]

Example: say 1 "Turner" "But why!? [wait_for_click]Why did you burn all the lettuce!?"

Put somewhere in the middle of a say command to pause the text printing until the player left clicks.

Name Tag Color

Command: set_dialogue_color # r g b

Example: set_dialogue_color 2 0.8 0 0.8

When participant # says something, their name tag will have the color specified by the float values in r, g, b (red, green, blue).

Voice

Command: set_dialogue_voice # i

Example: set_dialogue_voice 2 8

Sets the voice of participant # to i.

In the menu bar of the dialogue editor, go to Edit → Preview Voice and click and drag through the slider to hear previews of all the different voices.

Camera Position

Command: set_cam tx ty tz rx ry rz

Example: set_cam 5.0 3.1 2.5 0.0 0.0 0.0

Sets the location of the camera for the next say command to tx, ty, tz (translation x, y, z), and sets the rotation to rx, ry, rz (rotation x, y, z).

You don't need to set this manually in the script because this line will be generated automatically when you move the camera object that is located on the dialogue hotspot by default when editing a dialogue. Keep in mind that when you do this you need to first select the say command in the script that you want to change the camera angle for, as the set_cam line will be put before that line.

However, in some cases it can be very useful to be able to copy a set_cam line from one place to another and things like that.

Character Position

Command: set_character_pos # x y z r

Example: set_character_pos 1 3.0 0.0 5.0 30

Sets the location of participant # to x, y, z, and rotates them around the vertical axis r degrees.

Just like with camera positions you don't need to manually set character positions in the script since the appropriate line of code will be automatically generated when you move one of the character position boxes that can be found by default on each participant's spawn box. As with camera positions, you need to make sure to select the say line that you want to edit before making any changes.

Copying and pasting set_character_pos lines can be useful to reuse positions in cutscenes without having to set them up again.

Pose

Command: send_character_message # "set_animation \"$\""

Example: send_character_message 1 "set_animation \"Data/Animations/r_dialogue_shade.anm\""

Makes participant # play the animation at $. Note that we're using \" to "escape" the " characters.

You don't have to write this line manually because it can be generated for you if you do the following:

  1. Click on the say line in the dialogue that you want the animation to play for
  2. Select the dialogue character position box in the 3D view for the character you want to play an animation
  3. In the dialogue editor's menu bar, press File → Load Pose and load the animation you want

All animations can be found in the ../Overgrowth/Data/Animations/ folder.

Eye, Head & Torso Movement

Command: send_character_message # "$ x y z i"

Example: send_character_message 2 "set_head_target 5.0 3.2 1.1 0.8"

Makes participant # turn their $ towards location x, y, z, with the influence i. If i is 1, it will face as much towards x, y, z as possible, and if it's 0 the command has no effect.

$ Can be set to set_head_target or set_torso_target. set_eye_dir used to work, but currently dosn't.

This command doesn't need to be written manually, because it will be automatically set for the currently selected say line when you move one of the eye, head or torso targets. Scale the targets to change the influence.

Depth of Field

Command: send_level_message "set_camera_dof cs cd cg fs fd fg"

Example: send_level_message "set_camera_dof 0.3 5.0 10.0 0.3 20.0 10.0"

  • cs = Close blur strength
  • cd = Anything closer than this value will be blurred
  • cg = How gradual the transition for close dof should be, 0 = infinite blur
  • fs = Far blur strength
  • fd = Anything further than this value will be blurred
  • fg = How gradual the transition for far dof should be, 0 = infinite blur

The depth of field is split into two parts with three parts in each, the close blur and the far blur. First in each part is how strong the blur should be (xs), then at what distance it should end/start (xd), and then how long the transition from/to the blur should be (cg).

Fade to Black

Command: fade_to_black $

Example: fade_to_black 1

$ can be set to 1 to make the view fade to black on the next say command. If you set it to 0 afterwards, you get some visual bugs in the dialogue.

Checkpoints

There are a few commands that can be used in dialogues to trigger checkpoints and things like that.

TODO: Should we list those functions here too?