diff --git a/README.md b/README.md index 3d0e036..a454ded 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ option A reply/answer to the text the NPC said. precondition/ All listed preconditions have to be true in order for the NPC prerequirement to offer this option. -effect/result Further effects (like setting variables, handing out items) - selecting a particular option has. - action An action the player may (or may not) take, i.e. trading, taking an item from the NPC, giving the NPC something, entering the right password etc. +effect/result Further effects (like setting variables, handing out items) + that take place after the action was successful. + How to configure NPC and add dialogs ==================================== There are two ways: @@ -134,3 +134,46 @@ If unsure where to put your trades: If your NPC wants to tell players a story about what he sells (or if it is i.e. a barkeeper), put your trades in the options of dialogs. If you just want to sell surplus items to other players and have the NPC act like a shop, then use the trade list. + + +Quest items +=========== +Quest items can be *created* to some degree as part of the *action* of an +*option* through the edit options menu. + +MineTest does not allow to create truely new items on a running server on +the fly. What can be done is giving specific items (i.e. *that* one apple, +*that* piece of paper, *that* stack of wood, ..) a new description that +makes it diffrent from all other items of the same type (i.e. all other +apples). + +A new description alone may also be set by the player with the engraving +table (provided that mod is installed): + https://forum.minetest.net/viewtopic.php?t=17482 + +In order to distinguish items created by your NPC and those created through +the engraving table or other mods, you can set a special ID. That ID will +also contain the name of the player to which the NPC gave the item. Thus, +players can't just take the quest items of other players from their bones +and solve quests that way. + +The actions *npc_gives* and *npc_wants* are responsible for handling of +quest items. They can of course also handle regular items. + +If an NPC creates a special quest item for a player in the *npc_gives* +action, it takes the item out of its inventory from a stack of ordinary +items of that type and applies the necessary modifications (change +description, set special quest ID, set information which player got it). + +If the NPC gets such a quest item in an *npc_wants* action, it will check +the given parameters. If all is correct, it will strip those special +parameters from the item, call the action a success and store the item +in its inventory without wasting space (the item will likely stack if it +is *not* a quest item). + +Entering Passwords +================== +Another useful method for quests is the *text_input* action. It allows the +NPC to ask for a passwort or the answer to a question the NPC just asked. +The player's answer is checked against the *expected answer* that you give +when you set up this action.