the-lost-memory/project/addons/dialogic/Documentation/Content/Events/001.md

42 lines
3.7 KiB
Markdown
Raw Normal View History

2022-11-17 17:52:05 +00:00
# Text Event
![image](./Images/text_event_1.png)
The text event is one of the most important, since it contains most of your text.
## The header
![image](./Images/text_event_2.png)
There are three different types of options for Text Events:
- **Character** - This is who will be saying the text written inside the text editor.
- **Portrait** - If you picked a **Character**, the different portraits will show up here. If the **Character** doesn't have any special portraits, the default one will be used. If you pick the `(Don't change)` option, it will continue using the previous text event portrait set. If you pick the `[Definition]` option, a new picker will show up.
- **Definition** - You can select a **Definition**, and Dialogic will try to match that string with available portraits. This can be used to dynamically show different portraits depending on previous player input.
## The Text Editor
Inside the text editor, you have special features that might not be obvious:
- Each line will create a new text message. This will help make longer monologues without having to add a new **Text Event** for each message. If you want to disable this, you can do so in the Dialogic settings panel: `Settings -> Dialog -> New lines will create extra messages`.
- When writing a **Character** name, Dialogic will automatically color the text of that **Character**
- `[br]` This will add a line break in the position of the tag
- `[nw] / [nw=2] / [nw=v]` The *no wait* command will tell Dialogic to automatically continue with the next event without any user input. The default time for skipping to the next text is 2 seconds (after all characters are displayed), but you can change how many seconds by setting a number to it (like `[nw=5]` for 5 seconds). You can use [nw=v] to continue after the audio (if any is used) finished.
- `[speed=X]` You can use the *speed* tag to change the speed during a text event. Placed at the beginning of the event, it will affect the whole text, but each following speed command will overwrite the previous one. Higher numbers result in slower speeds and lower ones in faster speeds. If you want the text to be instant for one message you can do `[speed=0]` and make it show up instantly.
After the event containing the *speed* tag is passed, it will go back to whatever default value you have set on the current theme.
- `[definition]` If you have a **Definition**, and you want to display its value on inside your text you can use the `[` and `]` characters and the name of your **Definition** within them. Let's say we have a **Definition** called `Money` with the value of `5`. we can write: `You have [Money] left` and Dialogic will replace the `[Money]` tag with the value `You have 5 left`.
- `[word1,word2,word3]` You can write a list of words like this: `[word1,word2,word3]` and the text event will pick a random word from the list. If the word is a Dialogic variable name and gets picked, it will show the value of that variable.
- `[signal=argument]` will emit the dialogic signal with the given argument as a String when this place is reached.
- `[pause=1]` will stop displaying new characters for 1 second before continuing.
- `[play=click.wav]` will play an audio file with the given name. These files have to be located in `"res://dialogic/sounds/"`.
- Besides these Dialogic specific options, you can also use the default `BBCode` options that every `RichTextLabel` has like [b]bold[/b] or [i]italic[/i] text, [color=red]colored text[/color] and [wave]using effects![/wave] More about that can be found [here](https://docs.godotengine.org/en/stable/tutorials/gui/bbcode_in_richtextlabel.html).
## Voice Line Support
You can find a tutorial on how to use the voice line feature in the tutorials folder!