From 73b9fc74a1f42f200640625c7ed4d9d059b28c8f Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Mon, 20 Aug 2012 21:07:33 +0200 Subject: [PATCH] Finished formatting and etc --- mtmoddeven.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mtmoddeven.txt b/mtmoddeven.txt index ce25c61..f899adb 100644 --- a/mtmoddeven.txt +++ b/mtmoddeven.txt @@ -231,13 +231,17 @@ for Linux systemwide installation, these mods are in /usr/share/minetest/games/m -Chapter 3: ABMs & Positioning +Chapter 4: ABMs & Positioning ============================= ABMs add actions to blocks. For instance, the tutorial-wood could become normal wood after a few seconds. Append this code to your init.lua: +---------------------------------------------------- +| Code | +---------------------------------------------------- + minetest.register_abm( {nodenames = {"tutorial:decowood"}, interval = 30, @@ -247,7 +251,11 @@ minetest.register_abm( end, }) -Try it out! It's really annoying to see all your decowood creations destroyed after 30 seconds, they simple become normal wood. +---------------------------------------------------- +| Code | +---------------------------------------------------- + +Try it out! It's really annoying to see all your decowood creations destroyed after 30 seconds, they simply become normal wood. But how does this work? The function minetest.register_abm registers an action for each block of the same type. @@ -286,6 +294,10 @@ minetest.register_abm( end, }) +---------------------------------------------------- +| end of Code | +---------------------------------------------------- + You should already know everything else but the line pos.y=pos.y+1. What is that for? @@ -309,7 +321,7 @@ There are some small other differences to our first abm. The interval is 1 in th Credits and Afterword ===================== -This is Jeija's modding tutorial Version 20120218, rewriten and formated for english by "Rubenwardy" +This is Jeija's modding tutorial Version 20120218, Rewriten and formated for english by "Rubenwardy" Check for new version on github.com/Jeija/minetest-modding-tutorial.