From ee10fcd6fd565690758da862bd0faa9d54391c78 Mon Sep 17 00:00:00 2001 From: Ezhh Date: Tue, 29 Aug 2017 00:21:46 +0100 Subject: [PATCH] Active Block Modifiers: Improve grammar, and clarify some points --- en/chapters/abms.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/en/chapters/abms.md b/en/chapters/abms.md index 75f52b0..9453657 100644 --- a/en/chapters/abms.md +++ b/en/chapters/abms.md @@ -6,20 +6,19 @@ root: ../../ ## Introduction -In this chapter we will learn how to create an **A**ctive **B**lock **M**odifier (**ABM**). -An active block modifier allows you to run code on certain nodes at certain -intervals. -Please be warned, ABMs which are too frequent or act on too many nodes cause -massive amounts of lag. Use them lightly. +An active *A**ctive **B**lock **M**odifier (**ABM**) allows you to run code on +certain nodes at specific intervals. +Please be warned, ABMs which are too frequent or act on a large number of nodes +cause massive amounts of lag. Use them sparingly. * Special Growing Grass * Your Turn ## Special Growing Grass -We are now going to make a mod (yay!). -It will add a type of grass called alien grass - it grows near water on grassy -blocks. +If you want to make a mod that adds a type of grass called alien grass +- it grows near water on grassy blocks - you first register the grass, then +write an ABM. {% highlight lua %} minetest.register_node("aliens:grass", { @@ -41,12 +40,17 @@ minetest.register_abm({ }) {% endhighlight %} -Every ten seconds the ABM is run. Each node which has the correct nodename and -the correct neighbors then has a 1 in 5 chance of being run. If a node is run on, -an alien grass block is placed above it. Please be warned, that will delete any -blocks above grass blocks - you should check there is space by doing minetest.get_node. +This ABM runs every ten seconds. There is a 1 in 5 chance of the ABM running on each +node that has the correct name and the correct neighbors. If the ABM runs on a +node, an alien grass node is placed above it. Please be warned, this will delete any +node previously located in that position. To prevent this you should include a check +using minetest.get_node to make sure there is space for the grass. -That's really all there is to ABMs. Specifying a neighbor is optional, so is chance. +Specifying a neighbor is optional. If you specify multiple neighbors, only one of them +needs to be present to meet the requirements. + +Specifying chance is also optional. If you don't specify the chance, the ABM will +always run when the other conditions are met. ## Your Turn