From d810d16b88e30cc19972e51fff94e5fbb36c8c37 Mon Sep 17 00:00:00 2001
From: Rubenwardy So what is default? 'default' is the most important "mod" of minetest, in fact minetest itself is more like just a game engine,
all the contents, materials, and other stuff are in several mods, like 'default' (standard tools/blocks), 'bucket' (Buckets: Lava/Water),... You should already know everything else but the line "pos.y=pos.y+1".
+But there is a solution! Part Two: ABMs
-
+
+Part Three: Lua Files and Debuging
+
@@ -122,8 +128,8 @@ To do this on Windows, use WordPad.
Click file>save as, dropdown to all fil
Tutorial 1: Decowood
-Chapter 2: [tutorial] Your first mod!
+Part One: Declaring and Crafting Nodes
+Chapter 2: Defining a node
We are going to make a mod that adds a special kind of wood that can only be used for decoration.
For this, create a new mod called 'tutorial' using the method described in Chapter 0.
@@ -213,8 +219,8 @@ In this case The crafting recipe is like this:What is the mod "default"?
+
Chapter 5: The Position Variable
+
The Position Variable
To understand the position variable, you need to know that in 3d space, positions are determind by three co-ordinates: x,y,z
@@ -304,6 +310,110 @@ The player usually spawns near 0,0,0.
The interval is 1 in this case, but the chance (probability) is 100.Therefore the function is executed every second, but only in 1 of 100 cases.
This makes your minetest garden slowly been overgrown by junglegrass.
+Part Three - Lua Files and Debugging
+Chapter # - Including Files
+The dofile function
+Sometimes you have so much code, a single init.lua file is too hard to maintain.
+
+dofile(minetest.get_modpath("chess").."/anotherfile.lua")
will tell Minetest to look for anotherfile.lua in the same folder as init.lua, and add load its contents.
+Chapter # - Debugging
+Types of errors and Bugs
+As with most programming, when you develop you tend to get what are called "bugs" and errors, which are basically human mistakes.
+There are three types of bugs/errors
+
+
+
+Which one of these codes is easier to read?
+
+
+ |
+
+pos.y=pos.y+1 --This line increases the position's y axis by 1
+
+
+The Console is the black window with writing in that appears when Minetest runs. + |
LUA has a function called "print" and it displays a message to the console.
+ +
+
+print("message to send")
+
+
+
Why use print |
---|
+For example, you have a mistake in the code:
+
+
+ +And so having print helps point out your mistake. + |