Functions (called statements) listed below you should use them as part of dialogue event.
You can call this functions from Rakugo like: `Rakugo.say()`, but we don't recommend this.
This function is like this:
say("character_tag", "Text to say by character.", parameters)
Args:
- Tag of character set when you create character, if
null
then it will use default Narrator - Text to be sed by character it can use markup
- Additional parameters in from of dictionary, default empty.
Build in additional parameters:
markup
- use different then default markup for this dialogue part.
Additional parameters from visual novel template:
typing
- turn on/off typing effect for this dialogue.typing_effect_delay
- overwrite typing effect delay for this part of dialogue.typing_effect_punctuation_factor
- overwrite typing effect punctuation factor for this part of dialogue.
To define new character use this function:
Rakugo.define_character("Character Name", "character_tag", character_label_tag)
For example:
Rakugo.define_character("Cool Developer", "cool", Color.aquamarine)
Use this example character in dialogue:
# this example uses markdown as markup
say("cool", "I'm cool :sunglasses: Developer")
This function can be used to get information (as string) from player.
var player_input = ask("default_answer", parameters)
- default value returned by ask if player just press enter and don't provided any input or empty string
- Additional parameters in from of dictionary, default empty.
Additional parameters from visual novel template:
placeholder
- text to display as hit for player, it will hide if player start to provided any input
Example of using ask to get player character name.
extends Dialogue
onready var player_ch = Rakugo.define_character("Player-kun", "player", Color.aqua)
func first_dialogue():
start_event("first_dialogue")
# this example use markdown as markup
say(null, "What is your name? (default: _<player.name>_.)", {"typing":false})
var player_name = ask("", {"placeholder": "Player Name"})
if cond(player_name != null):
player_ch.name = player_name
step()
What is `cond()` is explained [here](variables_and_conditions/#conditions).
This code give us this result in visual novel template:
This can be used to notify player of consequences of their decisions.
notify("notification text", parameters)
- Text to be displayed
- Additional parameters in from of dictionary, default empty. There are no build in parameters for this statement.
For example:
notify("Cool Developer will remember this.")