added update regarding custom actions to README.md

This commit is contained in:
Sokomine 2022-08-07 22:06:26 +02:00
parent 48e5af991c
commit 5da08359cb

View File

@ -20,7 +20,7 @@ Chat commands
grants NPC n_3 the right to execute
lua code as an effect/result
Note: If a precondition or effect originates from a generic
NPC, the priv will be considered granted if the
NPC, the priv will be considered granted if either the
executing NPC or the the generic NPC has the priv.
/npc_talk_generic Add or remove NPC from the list of generic dialog providers.
@ -47,7 +47,10 @@ action An action the player may (or may not) take, i.e. trading,
effect/result Further effects (like setting variables, handing out items)
that take place after the action was successful.
alternate text Text shown instead of the normal dialog text.
alternate text Text shown instead of the normal dialog text. This is useful
when you have a dialog with a lot of questions and want the
player to be able to easily select the next question without
having to create a new dialog for each option.
Special dialogs
===============
@ -236,21 +239,17 @@ when you set up this action.
Custom Preconditions, Actions and Effects
=========================================
You can define custom actions and provide a parameter. The function
yl_speak_up.get_fs_action_custom(player, param)
gets called when such a function is executed and ought to return a formspec.
Input ought to be sent to the function
yl_speak_up.input_fs_action_custom(player, formname, fields)
which acts as an example of what you need to take care of in your own
implementation of this function.
You can define custom actions and provide up to ten parameters. The file
custom_functions_you_can_override.lua
holds examplexs. Please do not edit that file directly. Just take a look
there and override functions as needed in your own files! That way it is
much easier to update.
You can also define custom preconditions and effects. For more information,
take a look at
custrom_functions_you_can_override.lua
In order to add custom functions, you need to be able to edit that file or
execute Lua code on the server.
NPC may need extra privs for some actions.
In general, the table
yl_speak_up.custom_functions_p_[ descriptive_name ]
holds information about the parameters for display in the formspec (when
setting up a precondition, action or effect) and contains the function
that shall be executed.
Alternate Text
==============