Lua_api.txt: Improve and complete ABM documentation

Document 'active object count (wider)'.
master
paramat 2018-01-12 00:32:55 +00:00 committed by paramat
parent b8fc6a1955
commit 05e9e128b9
1 changed files with 23 additions and 12 deletions

View File

@ -4438,19 +4438,30 @@ Definition tables
{ {
label = "Lava cooling", label = "Lava cooling",
-- ^ Descriptive label for profiling purposes (optional). ^ Descriptive label for profiling purposes (optional).
-- Definitions with identical labels will be listed as one. Definitions with identical labels will be listed as one.
-- In the following two fields, also group:groupname will work.
nodenames = {"default:lava_source"}, nodenames = {"default:lava_source"},
neighbors = {"default:water_source", "default:water_flowing"}, -- Any of these --[[ ^ Apply `action` function to these nodes.
^ If left out or empty, any neighbor will do ]] ^ `group:groupname` can also be used here.
interval = 1.0, -- Operation interval in seconds neighbors = {"default:water_source", "default:water_flowing"},
chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this ^ Only apply `action` to nodes that have one of, or any
catch_up = true, -- If true, catch-up behaviour is enabled --[[ combination of, these neighbors.
^ The chance value is temporarily reduced when returning to ^ If left out or empty, any neighbor will do.
an area to simulate time lost by the area being unattended. ^ `group:groupname` can also be used here.
^ Note chance value can often be reduced to 1 ]] interval = 1.0,
action = func(pos, node, active_object_count, active_object_count_wider), ^ Operation interval in seconds.
chance = 1,
^ Chance of triggering `action` per-node per-interval is 1.0 / this value.
catch_up = true,
^ If true, catch-up behaviour is enabled: The `chance` value is temporarily
reduced when returning to an area to simulate time lost by the area being
unattended. Note that the `chance` value can often be reduced to 1.
action = function(pos, node, active_object_count, active_object_count_wider),
^ Function triggered for each qualifying node.
^ `active_object_count` is number of active objects in the node's mapblock.
^ `active_object_count_wider` is number of active objects in the node's
mapblock plus all 26 neighboring mapblocks. If any neighboring mapblocks
are unloaded an estmate is calculated for them based on loaded mapblocks.
} }
### LBM (LoadingBlockModifier) definition (`register_lbm`) ### LBM (LoadingBlockModifier) definition (`register_lbm`)