Voxel Game Maker

Docs Cookbook

NPC with a quest

Place the character. What is it? ▸ Character, then Write what they say...

#Without code

  1. Place the character. What is it? ▸ Character, then Write what they say... (opens the Dialogue tab).
  2. In the dialogue, a Choice node: "Will you find my lost cat?".
  3. On the Yes answer, the action Start quest (Quest cat, Goal (shown) "Find the cat").
  4. At Start, a condition Has item Cat: on Yes, Take item Cat, Complete quest cat, Give item Coin 20.
  5. Use Quest is active / Quest is complete to change what they say on later visits.

#Quick code

Where it goes: on the NPC, Event: Player presses E.

if quest_done("cat") then
  self.say("Thanks again!")
elseif has("Cat") >= 1 then
  take("Cat") complete_quest("cat") give("Coin", 20)
elseif choice("Find my cat?", ["Yes", "No"]) == "Yes" then
  start_quest("cat", "Find the cat")
end