How to add new tutorial message
Tutorial "How to add help message like at the game start"
Files & folders needed:
assets/gameplay/help_tips.json
assets/ui/
assets/scripts/p_game.gd
assets/texts/lang_*.json
Structure of the tutorial message:
{
"id": "radiation_tip",
"topic_img": "rad_icn.png",
"topic_img_size": 64,
"text": "rad.tip.text"
}
id = unique ID for calling with scripts
topic_img = texture name relative to assets/ui/ folder
topic_img_size = size of the topic image texture
text = can be string or language key
Create a duplacate at the end of the file:
{
"id": "my_mod_tutorial",
"topic_img": "items/ecolog_outfit.png",
"topic_img_size": 64,
"text": "my.mod.tutorial.message.text"
}

Go to assets/texts/lang_en.json and add new language text key to the file.
"my.mod.tutorial.message.text": "Hello world! Tutorial message!\nIt can be [color=red]colored[/color]!\nOr even [center]centered[/center].\nAlso [b]BOLD[/b].\nAnd font size [font_size=48]like this[/font_size]\nOr it can be [right]right side[/right]"
Go to assets/scripts/p_game.gd and change new game tutorial id to yours at intro level changed function.
"intro":
# wait 2 seconds before tutorial message will appear
await get_tree().create_timer(2).timeout
game_process._show_tutorial("my_mod_tutorial")
Don't forget to check assets/scripts/p_app.gd script and check this line:
GameManager.GameProcess.show_tutorial = true
It must be true for showing any tutorial messages in the game.
Run the new game. After 2 seconds you will see popup message.

Last updated