Skip to main content

Quest

The Quest class. Use this to create new quests, and use the QuestManager to add your quest into the game.

Quests are single objects that do not contain sub-quests. We prefer to have sub-quests be separate quests, categorized with the same quest name.

id: String

The ID for your quest. For best practice, use the same ID for your dialogue.

name: String {name}

The name of your quest. For best practice, use the same name for all sub-quests in your overall quest.

description: String

The description of your quest which will be shown on the quest log.

mapKey: String

Use the map keys documentation to find the key you need to use. This can be blank if you don't want the quest to appear anywhere on the map (for whatever reason).

location: String

This is shown on the quest log for where the player should go. These are not hard-defined so you can put anything you want, but best practice is to put the map name.

parent: String = "newGame"

The parent quest ID, or the quest ID you need to have completed before this one becomes available.

If you want the quest to be available immediately, it is best practice to use "newGame" instead of leaving it blank.

The game will use the QuestManager to get the quest to check if it's complete. You only need to provide the string ID.

complete: bool = false

true or false dependent on if the quest is complete.

dialogueID: String

This is the path or dialogue ID to your dialogue. The game can automatically parse the file path if you give the ID only, only if you place the dialogue in the res://dialogue/ folder.

It is best practice to use the same quest and dialogue ID.

var quest = load("res://quests/Quest.gd").new()
quest.id = "townFuckQuestStart"
quest.dialogueID = "townFuckQuestStart"
quest.name = "Getting Clients"
quest.description = "Queen needs to find a way to get more clients!"
quest.mapKey = "MayorsOffice"
quest.location = "Easthollow Town"
quest.parent = "firstVisitTown"
quest.addGoldReward(100)
quest.addOutfitReward("Queen", "Maid")
quest.addExpReward("Queen", 300)
QB.quest.addQuest(quest)

addGoldReward(amount)

On quest completion, give the player gold.

amount: int

addRemoveGoldReward(amount: int)

On quest completion, remove the player's gold.

amount: int

addOutfitReward(girl, outfitID)

On quest completion, give the player an outfit.

girl: String

ID of the girl.

outfitID: String

ID of the outfit.

addExpReward(girl, amount)

On quest completion, give a girl EXP.

girl: String

ID of the girl.

amount: float

Amount of exp.

isActive(): bool

Check to see if the quest is active. Active quests will be shown in the quest log.

isComplete(): bool

Check to see if the quest is complete.

setComplete()

Sets the quest to complete and gives rewards if the quest completion was false. If you setComplete an already completed quest, it will not give rewards.