Learn About Dialogue, Again!
Okay, we have a new character and a new outfit for Queen. Let's add them to the res://dialogue/myModQuestEnd.gd
dialogue!
extends Dialogue
func _init().("myModQuestEnd"):
setBackground("res://assets/Maps/Town/TownBackground.png")
show("Queen", "left")
talk("", "Queen walks around town.")
talk("Queen", "Bubbles! Here kitty kitty!", "Sad")
talk("", "Cassie walks past Queen with a cat in her arms.")
talk("Queen", "Hey Cassie! Is that Bubbles?")
show("Cassie", "right")
talk("Cassie", "Hey Queen! Yeah, isn't she the cutest!")
talk("", "Bubbles meows.")
talk("Queen", "The mayor is looking for her.", "Sad")
talk("Cassie", "Well, it's not my fault Bubbles likes to hang out with me more than him!")
talk("Cassie", "Tell him, he knows where to find me!")
completeQuest("myModQuestEnd")
message("Congratulations!", "You found Bubbles! The day is saved!")
Let's put those clothes on before we show her on the screen, using equipOutfit("Queen", "MyModOutfit")
.
...
func _init().("myModQuestEnd"):
setBackground("res://assets/Maps/Town/TownBackground.png")
equipOutfit("Queen", "MyModOutfit")
show("Queen", "left")
talk("", "Queen walks around town.")
...
Let's add our custom character into the dialogue and make them say something. How about near the end?
...
talk("Cassie", "Tell him, he knows where to find me!")
show("MyCharacter", "right")
talk("MyCharacter", "Hey, what's up!")
...
Well, I didn't say the dialogue was going to make any sense, but we're done! Maybe you can change the dialogue to make our character not stand out.
Let's do one more thing before we finish this dialogue. In our mod template, we have a great picture of Queen and
Bubbles that we should add to this dialogue. To show this image during the dialogue we can use this line of
code: showImage("res://assets/images/QuestImages/queenAndBubbles.png")
. Let's add it to the end of the dialogue.
completeQuest("myModQuestEnd")
message("Congratulations!", "You found Bubbles! The day is saved!")
showImage("res://assets/images/QuestImages/queenAndBubbles.png")
We also want our picture to show up in the house gallery after we finish this quest. In the res://mods/MyMod/init.gd
file you will see this line of code:
# Add an image to the gallery
QB.image.addImage("res://assets/images/QuestImages/queenAndBubbles.png", "myModQuestEnd")
This line of code puts our image into the gallery and only shows it if the myModQuestEnd
quest is complete.
We're done! Let's try our mod out!