Skip to content

Commit 05e9e12

Browse files
committedJan 12, 2018
Lua_api.txt: Improve and complete ABM documentation
Document 'active object count (wider)'.
1 parent b8fc6a1 commit 05e9e12

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed
 

‎doc/lua_api.txt

+23-12
Original file line numberDiff line numberDiff line change
@@ -4438,19 +4438,30 @@ Definition tables
44384438

44394439
{
44404440
label = "Lava cooling",
4441-
-- ^ Descriptive label for profiling purposes (optional).
4442-
-- Definitions with identical labels will be listed as one.
4443-
-- In the following two fields, also group:groupname will work.
4441+
^ Descriptive label for profiling purposes (optional).
4442+
Definitions with identical labels will be listed as one.
44444443
nodenames = {"default:lava_source"},
4445-
neighbors = {"default:water_source", "default:water_flowing"}, -- Any of these --[[
4446-
^ If left out or empty, any neighbor will do ]]
4447-
interval = 1.0, -- Operation interval in seconds
4448-
chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this
4449-
catch_up = true, -- If true, catch-up behaviour is enabled --[[
4450-
^ The chance value is temporarily reduced when returning to
4451-
an area to simulate time lost by the area being unattended.
4452-
^ Note chance value can often be reduced to 1 ]]
4453-
action = func(pos, node, active_object_count, active_object_count_wider),
4444+
^ Apply `action` function to these nodes.
4445+
^ `group:groupname` can also be used here.
4446+
neighbors = {"default:water_source", "default:water_flowing"},
4447+
^ Only apply `action` to nodes that have one of, or any
4448+
combination of, these neighbors.
4449+
^ If left out or empty, any neighbor will do.
4450+
^ `group:groupname` can also be used here.
4451+
interval = 1.0,
4452+
^ Operation interval in seconds.
4453+
chance = 1,
4454+
^ Chance of triggering `action` per-node per-interval is 1.0 / this value.
4455+
catch_up = true,
4456+
^ If true, catch-up behaviour is enabled: The `chance` value is temporarily
4457+
reduced when returning to an area to simulate time lost by the area being
4458+
unattended. Note that the `chance` value can often be reduced to 1.
4459+
action = function(pos, node, active_object_count, active_object_count_wider),
4460+
^ Function triggered for each qualifying node.
4461+
^ `active_object_count` is number of active objects in the node's mapblock.
4462+
^ `active_object_count_wider` is number of active objects in the node's
4463+
mapblock plus all 26 neighboring mapblocks. If any neighboring mapblocks
4464+
are unloaded an estmate is calculated for them based on loaded mapblocks.
44544465
}
44554466

44564467
### LBM (LoadingBlockModifier) definition (`register_lbm`)

0 commit comments

Comments
 (0)
Please sign in to comment.