This section provides examples of how to use the quest
module.
You need to save the quest state and load it before the quest.init
function.
For this you can use Defold Saver module.
local saver = require("saver.saver")
local quest = require("quest.quest")
function init(self)
saver.init()
saver.bind_save_part("quest", quest.state)
quest.init()
end
Or you can use other save system
local quest = require("quest.quest")
local function save_quest_state()
-- Save a quest.state table as you wish
save_quest_state(quest.state)
end
local function load_quest_state()
-- Load a quest.state table as you wish
return load_quest_state_from_save()
end
function init(self)
quest.state = load_quest_state()
quest.init(quest_state)
end
- How to configure the module to fit your additional requirements
- How to add requirements to quest start
- How to add rewards from quests
- How category can be used
- Examples and how to use quest as daily tasks
- How to use quest as game progression