Updated Dev_Actions_Schedules (markdown)

Hector Kio 2017-09-18 11:22:29 -04:00
parent a55400d05e
commit 2259ecb700

@ -57,11 +57,49 @@ For both of the above, action/task is a constant defined in `npc.actions.cmd`, a
- Arguments: - Arguments:
- `pos`: If given, NPC will lay at the given position. - `pos`: If given, NPC will lay at the given position.
- `dir`: If given, NPC will lay and look at dir. - `dir`: If given, NPC will lay and look at dir.
- `PUT_ITEM`: - `PUT_ITEM`: Puts an item into an external (to the NPC) inventory. Supports either a player or node's inventory. The items are taken from the NPC's inventory. If the NPC doesn't have the item or the amount specified this function does nothing.
- `TAKE_ITEM`: - Arguments:
- `CHECK_ITEM`: - `player`: String containing the name of the player whose inventory will be used. Set to `nil` if using node's inventory
- `USE_OPENABLE`: Task. NPC will open/close any supported openable node like a door, fence gate, etc. - `pos`: Position of the node whose inventory will be used. Set to `nil` if using player's inventory.
- `USE_FURNACE`: - `inv_list`: A string specifying the inventory list where the item will be placed.
- `USE_BED` - `item_name`: A string containing the item's name
- `USE_SITTABLE` - `count`: An integer specifying how much items will be placed
- `is_furnace`: A boolean, if set to `true`, it will start its timer. __Note__: Currently only supports default furnaces.
- `TAKE_ITEM`: Takes an item from an external (to the NPC) inventory. Supports either a player or node's inventory. The items are taken from the external inventory. If the external inventory doesn't have the item or the amount specified this function does nothing.
- Arguments:
- `player`: String containing the name of the player whose inventory will be used. Set to `nil` if using node's inventory
- `pos`: Position of the node whose inventory will be used. Set to `nil` if using player's inventory.
- `inv_list`: A string specifying the inventory list where the item will be placed.
- `item_name`: A string containing the item's name
- `count`: An integer specifying how much items will be taken
- `CHECK_ITEM`: Simple function that checks if an external inventory contains an specified item in specific amounts. Works with both players and nodes' inventories.
- Arguments:
- `player`: String containing the name of the player whose inventory will be used. Set to `nil` if using node's inventory
- `pos`: Position of the node whose inventory will be used. Set to `nil` if using player's inventory.
- `inv_list`: A string specifying the inventory list where the item will be placed.
- `item_name`: A string containing the item's name to be searched
- `count`: An integer specifying amount of the item to be searched
- `USE_OPENABLE`: Action to open/close any supported openable node like a door, fence gate, etc.
- Arguments:
- `pos`: Position of the openable node
- `action`: Whether to open or close. Defined in `npc.actions.const.doors.action`
- `dir`: Direction in which the NPC is looking. Defined in `npc.direction`
- `USE_FURNACE`: Task. Sequence of actions that allows a NPC to use a furnace. Fuels and cookable items are taken from the NPC's inventory. If there's not enough of any, the task will not be performed. Fuels are limited to leaves, tree trunks, coalblocks and straw.
- Arguments:
- `pos`: Position of the furnace to use
- `item`: Item that will be cooked/smelt in furnace
- `freeze`: Whether to freeze or not the NPC while the furnace is working
- `USE_BED`: Task. Sequence of actions that allows the NPC to use a bed. Currently supports MTG beds and cottages' beds.
- Arguments:
- `pos`: Position of bed to be used.
- `action`: Whether to get up or lay on bed. Defined in `npc.actions.const.beds.action`.
- `USE_SITTABLE`: Task. Sequence of actions that allows the NPC to use a sittable node. Currently supports cottages' benches and to some extend, MTG stairs.
- Arguments:
- `pos`: Position of sittable node to be used.
- `action`: Whether to get up or sit on bed. Defined in `npc.actions.const.sittable.action`.
- `WALK_TO_POS`: Task. NPC will walk to the given position. This task uses the pathfinder to calculate the nodes in the path that the NPC will walk through, then enqueues `walk_step` actions, combined with correct directional rotations and opening/closing of doors on the path. - `WALK_TO_POS`: Task. NPC will walk to the given position. This task uses the pathfinder to calculate the nodes in the path that the NPC will walk through, then enqueues `walk_step` actions, combined with correct directional rotations and opening/closing of doors on the path.
- Arguments:
- `end_pos`: Destination position to reach
- `walkable`: An array of node names to consider as walkable nodes for finding the path to the `end_pos`
- `use_access_node`: Boolean, if `true`, when using places, it will find path to the "accessible" node (empty or walkable node around the target node) instead of to the target node. Default is `true`.
- `enforce_move`: Boolean, if `true` and no path is found from the NPC's position to the `end_pos`, the NPC will be teleported to the `end_pos` (or, if `use_access_node == true` it will teleport to the "accessible" node)