Skip to main content

Create Dialogue

This is a more in-depth guide on dialogue. To get the basics down, check out Create A Quest!

The guide below is piece-by-piece. Find an area you need help with and read the information. This is not a step-by-step guide. This is because dialogue is relative to your project and is best learned through examples you can copy for yourself.

Dialogue Options

Confirmation

Any type of dialogue option branches off into other dialogues. You do this by creating multiple dialogue files for each option. Let's look at a simple option, yes or no.

func _init().("findSukiYesGold"):
confirmation("Upgrade?", "Spend 300 gold to upgrade the brothel?")
ifResult("findSukiYesUpgrade", "findSukiNoUpgrade")

The confirmation function has two parameters, title and text. We ask the player a question, and they will say yes or no. After they answer, we are going to grab the result using ifResult and branch off to another dialogue depending on the answer.

You would now need to create the findSukiYesUpgrade and findSukiNoUpgrade dialogue files to continue this dialogue.

Question

Let's try something more complex, the question function. We want to ask the player a question and give them multiple options to choose from. Each option will trigger a different response, but in the end, they come back to the main dialogue branch.

# res://dialogue/scenes/walterTalk.gd
talk("Walter", "I've got 5 gold, what can I get?")
question(
"What should Queen do?",
[
{"answer": "Suck his dick", "dialogueID": "res://dialogue/walterSuck.gd"},
{"answer": "Pull down her pants", "dialogueID": "res://dialogue/walterFuck.gd"},
{"answer": "Kiss him", "dialogueID": "res://dialogue/walterKiss.gd"},
]
)
talk("Walter", "Oh yeah, that's some good stuff! I'm going to explode!!!")

Take a look at the format for the question function above. We ask the player a question and offer 3 answers to the question. Each answer will branch off to its own dialogue, but once it's done it will return to the final talk at the bottom.

Function Reference

You can call your own function using a function reference. We mainly use this to check for outfits before a quest starts. The function below checks to see if the player has unlocked the maid outfits for Queen and Esxea.

func _init().("cleanUpCrewEnd"):
callFunc(funcref(self, "checkOutfits"))
ifResult("cleanUpCrewEndYes", "cleanUpCrewEndNo")


func checkOutfits():
return QB.character.getCharacter("Queen").getOutfit("Maid").unlocked && QB.character.getCharacter("Esxea").getOutfit("Maid").unlocked

Best Practices

Character Position

It is best to show the main characters on the left side of the screen, instead of right.