mirror of
https://github.com/MinetestForFun/quests.git
synced 2025-06-28 06:30:19 +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:
22
README
22
README
@ -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
|
||||
|
Reference in New Issue
Block a user