Voxel Game Maker

Docs Cookbook

Fetch quest with objectives

On the NPC, a Rule (Trigger) When the player presses E, condition Quest not started, Then Start quest (an id and the goal text).

#Without code

  1. On the NPC, a Rule (Trigger) When the player presses E, condition Quest not started, Then Start quest (an id and the goal text).
  2. A second Rule: conditions Quest is active and Has item (Herb, 3), Then Take item, Complete quest and Give XP.

#Quick code

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

if not quest_active("herbs") and not quest_done("herbs") then
  start_quest("herbs", "Bring 3 herbs")
elseif quest_active("herbs") and has("Herb") >= 3 then
  take("Herb", 3)
  complete_quest("herbs")
  give_xp(50)
end