Fork du dépôt quests. https://sys4.fr/gitea/Minetest/quests
Go to file
2016-02-05 13:12:43 +01:00
locale Update translation 2015-07-15 17:59:16 +02:00
sounds Add central messages and sounds for quest actions 2015-07-15 14:33:43 +02:00
textures Icons, tasks 2015-07-24 22:29:05 +02:00
central_message.lua Convert comment to markup-LDoc format, update them to the new tasked quests definition 2015-07-24 13:29:15 +02:00
core.lua Fix crashes on quest abort/accept when HUD is hidden 2016-02-05 13:12:43 +01:00
depends.txt Add central messages and sounds for quest actions 2015-07-15 14:33:43 +02:00
formspecs.lua Make tasked quests work with HUD 2015-07-27 00:31:07 +02:00
hud.lua Ugly fix for MT engine HUD bug, better error reporting 2015-11-22 22:47:45 +01:00
init.lua Don't write HUD table to save file since the new HUD code does HUDtable diffs and handles all cases 2015-07-27 23:19:05 +02:00
inventory_plus.lua Basic support for advanced inventories 2015-03-04 19:31:28 +01:00
README Replace statbar with scaled image to remove deprecation warning 2015-07-16 21:15:18 +02:00
unified_inventory.lua Icons, tasks 2015-07-24 22:29:05 +02:00

quests 1.1

quests is a simple quest framework for minetest that lets you define your own quests and handels the representation.

Dependencies:
intllib (optional)
unified_inventory or inventory_plus (optional)
central_message (optional)

License: WTFPL
Sounds: CC-BY
Textures: CC-BY

-------------------------------------------------------------------------------

You can see a full list of your active quests with the chatcommand /quests

API:
quests.register_quest(questname,quest)
-- registers a quest for later use
--
-- questname is the name of the quest to identify it later
--      it should follow the naming conventions: "modname:questname"
-- quest is a table in the following format
--      {
--        title,                -- is shown to the player and should contain usefull information about the quest.
--        description,          -- a small description of the mod.
--        max,                  -- is the desired maximum. If max is 1, no maximum is displayed. defaults to 1
--        autoaccept,           -- is true or false, wether the result of the quest should be dealt by this mode or the registering mod.
--        callback              -- when autoaccept is true, at the end of the quest, it gets removed and callback is called.
--                              -- function(playername, questname, metadata)
--      }
--
-- returns true, when the quest was successfully registered
-- returns falls, when there was already such a quest

quests.start_quest(playername, questname)
-- starts a quest for a specified player
--
-- playername - the name of the player
-- questname  - the name of the quest, which was registered with quests.register_quest
-- metadata   - optional additional data
--
-- returns false on failure
-- returns true if the quest was started

quests.update_quest(playername, questname, value)
-- when something happens that has effect on a quest, a mod should call this method
-- playername is the name of the player
-- questname is the quest which gets updated
-- the quest gets updated by value
-- this method calls a previously specified callback if autoaccept is true
-- returns true if the quest is finished
-- returns false if there is no such quest or the quest continues

quests.accept_quest(playername, questname)
-- When the mod handels the end of quests himself, e.g. you have to talk to somebody to finish the quest,
-- you have to call this method to end a quest
-- returns true, when the quest is completed
-- returns false, when the quest is still ongoing

quests.abort_quest(playername, questname)
-- call this method, when you want to end a quest even when it was not finished
-- example: the player failed
--
-- returns false if the quest was not aborted
-- returns true when the quest was aborted

quests.show_hud(playername)
-- shows the hud to player playername

quests.hide_hud(playername)
-- hides the hud for player playername

quests.show_formspec(playername)
-- shows the player playername his/her questlog

quests.get_metadata(playername, questname)
-- get metadata of the quest if the quest exists, else return nil

quests.set_metadata(playername, questname, metadata)
-- set metadata of the quest