Convert to .MD docs

This commit is contained in:
BrunoMine 2017-11-04 12:39:52 -02:00
parent 4170d56e62
commit 2ce1e8afbc
2 changed files with 22 additions and 13 deletions

View File

@ -3,20 +3,26 @@ Advanced_NPC Alpha-2 (DEV)
==========================
IMPORTANT: In this documentation is only the explanation of the particular operation of each predefined
action and task. Read reference documentation for details about API operation at `API.txt`.
action and task. Read reference documentation for details about API operation at `api.md`.
Action (`add_action`)
---------------------
* `SET_INTERVAL` : Set the interval at which the `action` are executed.
args = {
Definition tables
-----------------
#### `SET_INTERVAL`
Set the interval at which the `action` are executed.
{
interval = 1, -- A decimal number, in seconds (default is 1 second)
freeze = false, -- if true, mobs_redo API will not execute until interval is set
}
* `FREEZE` : This action allows to stop/execute mobs_redo API.
This is good for stopping the NPC from fighting, wandering, etc.
Arguments table definition
#### `FREEZE`
This action allows to stop/execute mobs_redo API.
This is good for stopping the NPC from fighting, wandering, etc.
{
freeze = false, -- Boolean, if true, mobs_redo API will not execute.
}
@ -24,8 +30,9 @@ Action (`add_action`)
Tasks (`add_task`)
------------------
* `USE_BED` : Sequence of actions that allows the NPC to use a bed.
Arguments table definition
#### `USE_BED`
Sequence of actions that allows the NPC to use a bed.
{
pos = {x=0,y=0,z=0}, -- Position of bed to be used.
action = action, --[[

View File

@ -3,7 +3,7 @@ Advanced_NPC API Reference Alpha-2 (DEV)
* More information at <https://github.com/hkzorman/advanced_npc/wiki>
IMPORTANT: This WIP & unfinished file contains the definitions of current advanced_npc functions
(Some documentation is lacking, so please bear in mind that this WIP file is just to enhance it.)
(Some documentation is lacking, so please bear in mind that this WIP file is just to enhance it)
Introduction
------------
@ -42,8 +42,8 @@ Or after add in the world
NPC Steps
---------
The API works with NPC steps, then then `on_step` callback need
run the `npc.on_step(luaentity)`. This function process the NPC actions
The API works with NPC steps, then `on_step` callback need run the
`npc.on_step(luaentity)`. This function process the NPC actions
and return the freeze state, which is used for stop mobs_redo behavior.
Example:
@ -58,9 +58,9 @@ Here is a recommended code.
do_custom = function(self, dtime)
-- Here is my "do_custom" code
-- Here is my "do_custom" code
-- Process the NPC action and return freeze state
-- Process the NPC action and return freeze state
return npc.on_step(self)
end
@ -163,12 +163,14 @@ Definition tables
Examples:
Syntax example 1:
npc.dialogue.register_dialogue({
text = "Hello.", -- "Hello." will be said by the NPC upon rightclick and displayed in the messages section.
tags = {"unisex", "phase1"} -- The flags that define the conditions of who and what can say the text.
})
Syntax example 2:
npc.dialogue.register_dialogue({
text = "Hello again."
-- The tags object is excluded, meaning that any NPC can say "Hello again." upon rightclick under no condition.