Difference between revisions of "Dialogue Editor"

From Wolfire Games Wiki
Jump to: navigation, search
m (Dialogue)
(Camera Position: Included information about a minor bug.)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
'''TODO: Figure out how to best cover all the missing send_level_message and send_character_message commands.'''
 +
 
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.
 
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.
 
Before reading this article it's recommended that you read the [[Dialogue]] article to get a basic understanding of how dialogues work.
  
== Dialogue ==
+
== General Dialogue Functions ==
 +
 
 +
=== Set Dialogue Name ===
 +
Command: <code>#name "$"</code>
 +
 
 +
Example: <code>#name "chat_with_villager"</code>
 +
 
 +
Sets the name of the current dialogue to whatever is written in <code>$</code>. This can be used by some other hotspots to start the dialogue.
 +
 
 +
=== Set Number of Participants ===
 +
Command: <code>#participants $</code>
 +
 
 +
Example: <code>#participants 3</code>
 +
 
 +
Sets the number of participants in the dialogue to the number written in <code>$</code>.
 +
 
 +
=== Dialogue ===
 
Command: <code>say # "n" "m"</code>
 
Command: <code>say # "n" "m"</code>
  
== Camera Position ==
+
Example: <code>say 1 "Turner" "Hello, I am participant 1 in the dialogue and my name is Turner."</code>
 +
 
 +
Makes participant <code>#</code> say <code>m</code> while the name tag shows <code>n</code>.
 +
 
 +
=== Waiting ===
 +
Command: <code>[wait $]</code>
 +
 
 +
Example: <code>say 1 "Turner" "Hmm... [wait 0.5]I should eat some carrots!"</code>
 +
 
 +
Put somewhere in the middle of a say command to pause the text printing for <code>$</code> seconds.
 +
 
 +
=== Wait For Click ===
 +
Command: <code>[wait_for_click]</code>
 +
 
 +
Example: <code>say 1 "Turner" "But why!? [wait_for_click]Why did you burn all the lettuce!?"</code>
 +
 
 +
Put somewhere in the middle of a say command to pause the text printing until the player left clicks.
 +
 
 +
=== Name Tag Color ===
 +
Command: <code>set_dialogue_color # r g b</code>
 +
 
 +
Example: <code>set_dialogue_color 2 0.8 0 0.8</code>
 +
 
 +
When participant <code>#</code> says something, their name tag will have the color specified by the float values in <code>r, g, b</code> (red, green, blue).
 +
 
 +
=== Voice ===
 +
Command: <code>set_dialogue_voice # i</code>
 +
 
 +
Example: <code>set_dialogue_voice 2 8</code>
 +
 
 +
Sets the voice of participant <code>#</code> to <code>i</code>.
 +
 
 +
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: <code>set_cam tx ty tz rx ry rz</code>
 
Command: <code>set_cam tx ty tz rx ry rz</code>
  
== Character Position ==
+
Example: <code>set_cam 5.0 3.1 2.5 0.0 0.0 0.0</code>
 +
 
 +
Sets the location of the camera for the next <code>say</code> command to <code>tx, ty, tz</code> (translation x, y, z), and sets the rotation to <code>rx, ry, rz</code> (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 <code>say</code> command in the script that you want to change the camera angle for, as the <code>set_cam</code> line will be put before that line.
 +
 
 +
However, in some cases it can be very useful to be able to copy a <code>set_cam</code> line from one place to another and things like that.
 +
 
 +
Sometimes, adjusting things in a line of dialogue will extraneously add another <code>set_cam</code> line. You'll want to remove this in order to maintain a steady camera.
 +
 
 +
=== Character Position ===
 
Command: <code>set_character_pos # x y z r</code>
 
Command: <code>set_character_pos # x y z r</code>
  
== Pose ==
+
Example: <code>set_character_pos 1 3.0 0.0 5.0 30</code>
Command: <code>send_character_message # "set_animation \"a\""</code>
+
 
 +
Sets the location of participant <code>#</code> to <code>x, y, z</code>, and rotates them around the vertical axis <code>r</code> degrees.
 +
 
 +
Just like with [[#Camera_Position|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 <code>say</code> line that you want to edit before making any changes.
 +
 
 +
Copying and pasting <code>set_character_pos</code> lines can be useful to reuse positions in cutscenes without having to set them up again.
 +
 
 +
'''There's a minor bug that you need to watch out for: Sometimes, adjusting things in a new line of dialogue will extraneously add another <code>set_character_pos</code> line. You'll want to remove this duplicate line, as it will interrupt animation blending.'''
 +
 
 +
=== Pose ===
 +
Command: <code>send_character_message # "set_animation \"$\""</code>
 +
 
 +
Example: <code>send_character_message 1 "set_animation \"Data/Animations/r_dialogue_shade.anm\""</code>
 +
 
 +
Makes participant <code>#</code> play the animation at <code>$</code>. Note that we're using ''\"'' to "escape" the <code>"</code> characters.
 +
 
 +
You don't have to write this line manually because it can be generated for you if you do the following:
 +
 
 +
# Click on the <code>say</code> line in the dialogue that you want the animation to play for
 +
# Select the dialogue character position box in the 3D view for the character you want to play an animation
 +
# 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.
 +
 
 +
There are two bugs you should watch out for:
 +
 
 +
* '''There is a very, very troubling bug that you need to be wary of:''' If you click Load Pose, there's a small chance there will be two browser windows. If this happens, close both and try again. Otherwise, the dialogue editor will become non-functional.
 +
* If the <code>set_animation</code> field points to an incorrect or incomplete path, the game will crash. If you need to type the animation path, you should copy and paste the path manually instead of typing.
 +
 
 +
=== Eye, Head & Torso Movement ===
 +
Command: <code>send_character_message # "$ x y z i"</code>
 +
 
 +
Example: <code>send_character_message 2 "set_head_target 5.0 3.2 1.1 0.8"</code>
 +
 
 +
Makes participant <code>#</code> turn their <code>$</code> towards location <code>x, y, z</code>, with the influence <code>i</code>. If <code>i</code> is <code>1</code>, it will face as much towards <code>x, y, z</code> as possible, and if it's 0 the command has no effect.
 +
 
 +
<code>$</code> Can be set to <code>set_head_target</code> or <code>set_torso_target</code>. <code>set_eye_dir</code> 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 <code>say</code> line when you move one of the eye, head or torso targets. Scale the targets to change the influence.
 +
 
 +
=== Depth of Field ===
 +
Command: <code>send_level_message "set_camera_dof cs cd cg fs fd fg"</code>
 +
 
 +
Example: <code>send_level_message "set_camera_dof 0.3 5.0 10.0 0.3 20.0 10.0"</code>
 +
 
 +
'''NOTE:''' The player character needs to be connected to the dialogue for it to work.
 +
 
 +
* 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 (<code>xs</code>), then at what distance it should end/start (<code>xd</code>), and then how long the transition from/to the blur should be (<code>cg</code>).
 +
 
 +
=== Fade to Black ===
 +
Command: <code>fade_to_black $</code>
  
== Eye, Head & Torso Movement ==
+
Example: <code>fade_to_black 1</code>
Command: <code>send_character_message # "a"
 
  
== Fading ==
+
<code>$</code> can be set to 1 to make the view fade to black on the next <code>say</code> command. If you set it to 0 afterwards, you get some visual bugs in the dialogue.
  
== Other Features ==
+
[[Category: Overgrowth]]
'''TODO: Add missing features'''
+
[[Category: Modding]]

Latest revision as of 21:12, 12 July 2022

TODO: Figure out how to best cover all the missing send_level_message and send_character_message commands.

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.

Sometimes, adjusting things in a line of dialogue will extraneously add another set_cam line. You'll want to remove this in order to maintain a steady camera.

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.

There's a minor bug that you need to watch out for: Sometimes, adjusting things in a new line of dialogue will extraneously add another set_character_pos line. You'll want to remove this duplicate line, as it will interrupt animation blending.

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.

There are two bugs you should watch out for:

  • There is a very, very troubling bug that you need to be wary of: If you click Load Pose, there's a small chance there will be two browser windows. If this happens, close both and try again. Otherwise, the dialogue editor will become non-functional.
  • If the set_animation field points to an incorrect or incomplete path, the game will crash. If you need to type the animation path, you should copy and paste the path manually instead of typing.

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"

NOTE: The player character needs to be connected to the dialogue for it to work.

  • 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.