1
0
mirror of https://github.com/TeTpaAka/quests.git synced 2025-06-28 14:26:11 +02:00

Split quests.register_quest in two functions

Now register_quest only registers a quest and you have to start it with quests.start_quest()
This commit is contained in:
TeTpaAka
2015-02-28 11:48:27 +01:00
parent 403eb1aad8
commit 3e82fda965
2 changed files with 85 additions and 54 deletions

22
README
View File

@ -1,12 +1,18 @@
quests 0.1
quests is a simple quest framework for minetest that lets you define your own quests and handels the representation.
Dependencies: none
License: WTFPL
-------------------------------------------------------------------------------
You can see a full list of your active quests with the chatcommand /quests
API:
quests.register_quest(playername,questname,quest)
-- registers a quest for the specified player
-- registers a quest for later use
--
-- playername is the name of the player, who gets the quest
-- 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
@ -21,6 +27,15 @@ quests.register_quest(playername,questname,quest)
-- 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
--
-- 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
@ -39,6 +54,9 @@ quests.accept_quest(playername, questname)
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