Learn About Dialogue
In the previous guide we found the myModQuestStart
quest, but now let's open the dialogue for that quest! Open
the res://dialogue/myModQuestStart.gd
file to get started.
extends Dialogue
func _init().("myModQuestStart"):
setBackground("res://assets/Maps/Town/TownBackground.png")
show("Queen", "left")
show("Mayor", "right")
talk("Mayor", "Hey Queen, I need your help!")
talk("Queen", "What's up?")
talk("Mayor", "My pet cat has run off and I can't find her!", "Sad")
talk("Mayor", "She's about this big!")
talk("", "The mayor raises his hands in front of him.")
talk("Mayor", "And her name is Bubbles!")
talk("Queen", "Okay, I'll go find her.", "Sad")
completeQuest("myModQuestStart")
The structure for dialogues are simple. We initialize the function using the Godot _init()
function. To let Queen's
Brothel know what dialogue this is, we also supply the dialogue ID. It is best practice to match the dialogue ID and the
quest ID.
func _init().("myModQuestStart"):
Now we can start writing our dialogue. You'll notice that we start the dialogue off by setting the background
to a
picture of the town. Then we show
Queen on the left side of the screen, and the Mayor on the right side of the screen.
After that, we make the characters talk
until this quest is complete.
Let's add Esxea into this dialogue! And let's ignore the fact that Queen might not have met Esxea yet! Before we
complete the quest, let's show Esxea on the right side of the screen by adding this line of
code: show("Esxea", "right")
...
talk("Queen", "Okay, I'll go find her.", "Sad")
show("Esxea", "right")
completeQuest("myModQuestStart")
Now, let's make her say something. talk("Esxea", "Let me help!")
...
talk("Queen", "Okay, I'll go find her.", "Sad")
show("Esxea", "right")
talk("Esxea", "Let me help!")
completeQuest("myModQuestStart")
Now we're done. Try adding Esxea to the myModQuestEnd
dialogue file and make her say some funny stuff!
Let's go learn about custom characters and changing outfits!