RakuScript
RakuScript is Rakugo Dialogue scripting language inspired by Ren'Py Scripting Language.
You can use with RakuScriptDialogue node or using:
Label
It allows to split script to smaller parts between
you can jump between those parts with jump
or using menu
.
Label Example
Character
Create/Define a new character with this char_tag
and char_name
Character Example
character Gd Godot
Variable
Note
-
Setting variable create a new variable with this var_name and this value assigned.
-
If this variable already exist, value is replaced by new one.
Variable Example
# create / set variable
life = 5
# assign value form other variable
life = max_life
# assign value from character
life = Gd.max_life
Character's variable
Note
-
Setting variable create a new variable with this var_name on character with this
char_tag
, and this value assigned. -
If this variable already exist on this character, value is replaced by new one.
Character's variable example
# create / set character variable
Gd.friendship = 5
# assign value from other variable
Gd.friendship = max_friendship
# assign value from character
Gd.friendship = Gd.max_friendship
Say
Info
Form version 2.2 you can use double quotes "it is a "really" good one" in any string in RakuScript.
Character with this char_tag say String
When Say is executed, a signal sg_say is send with dictionary of data for the character with this char_tag and this String in parameter.
If no character with this char_tag is found, signal is send with an empty dictionary.
After Say is executed, Rakugo automatically waiting, it send a sg_step signal.
Say Example
# Character with tag `Gd` says "Hello!"
Gd "Hello !"
# No character / narrator says "Hello!"
"Hello!"
Say String
Note
When Say is executed, a signal [say] is send with empty dictionary and this String in parameter.
Use variables
You can use variables in Say, Rakugo replace them by their values in String before send signal [say].
Ask
It can be used get user input as string, for example you can use it to ask user for a his/her/their name.
[var_name] = ? [question]
[var_name] = ? [question] [placeholder]
[var_name] = ? [character_tag] [question] [placeholder]
Ask Example
Use variables
You can use variables in Ask, Rakugo replace them by their values in String before send signal sg_ask.
# <[var_name]> or <[char_tag].[var_name]>
player.name = ? "What is your name ?" "<default_player_name>"
Menu
It can be used to create a ui that switches between different branches of dialogue tree.
It must start it from menu menu_name:
"Choice"
- is choice and >
is used to jump to other label or menu.
Menu block ends with empty line.
After a Menu is executed, Rakugo waiting call of menu_return:
Use variables
You can use variables in Menu, Rakugo replace them by their values in String before send signal sg_menu.
# <[var_name]> or <[char_tag].[var_name]>
# player can change name of npc called by default emily
emily.name = ? "What is her name ?" "<emily.name>"
menu menu_emily:
"Talk with <emily.name>" > emily_talk
"Wait"
"Blop" > test_dialog
Jump
It will jump dialogue branch with given label_name or menu_label_name.
Jump Example
Jump If
It will jump dialogue branch with given label_name or menu_label_name if condition is true.