Try it out! It's really annoying to see all your decowood creations destroyed after 30 seconds, they simple become normal wood.
But how does this work?
The function minetest.register_abm registers an action for each block of the same type.
nodenames = {"tutorial:decowood'} means that the action is processed for each decowood block.
You could also try "default:stone" instead of that to turn all stone blocks into wood.
interval = 30 means that the action is performed every 30 seconds. It starts counting at the beginning of the game. After 30 seconds all actions are processed, it doesn't matter when the block was placed.
This is not a per-block timer!
chance = 1 means that the probability of the action is 1:1, it happens in every case.
A higher value means that it's less probable.
action = function(pos) is the function that is actually performed.
It contains the command minetest.env:add_node. This takes two parameters:
First of all the position parameter (more information later) and also a table which defines the properties of the block, e.g. the name, the direction it faces, ...
In this case the name is enough to define what block you can see.
No Chapter 3
In "Chapter 4" you have the line of code "chance = 100". Which to some people would be confused by it. So maybe reference what it does again.
Crafting does not only play an important role in minecraft, also minetest uses different crafting recipes
cosarara97 wrote:Thanks!
I found an error:
Line 49:Crafting does not only play an important role in minecraft, also minetest uses different crafting recipes
Shouldn't both be minetest? :)
Jeija wrote:Hello everyone!
I wrote the first few chapters of a modding tutorial for minetest. I put it on GitHub so that others can help by fixing my tons of mistakes and writing more.
I have made a German version (also with HTML) and an English version (txt only).
I am not gonna continue the German one, maybe someone else wants to do that.
Would be nice if some people tested it (Is it easy to understand, structured?)
Please help making this tutorial better so that more people can learn how to create mods!
Download
GitHub Repo
As .zip
As .tar.gz
This modding tutorial has been created for an open-source writing competition
Dieses Tutorial wurde im Rahmen eines Open-Source Schreibwettbewerbs erstellt
JoseMing wrote:Jeija wrote:Hello everyone!
I wrote the first few chapters of a modding tutorial for minetest. I put it on GitHub so that others can help by fixing my tons of mistakes and writing more.
I have made a German version (also with HTML) and an English version (txt only).
I am not gonna continue the German one, maybe someone else wants to do that.
Would be nice if some people tested it (Is it easy to understand, structured?)
Please help making this tutorial better so that more people can learn how to create mods!
Download
GitHub Repo
As .zip
As .tar.gz
This modding tutorial has been created for an open-source writing competition
Dieses Tutorial wurde im Rahmen eines Open-Source Schreibwettbewerbs erstellt
jeija, what you need to make a "init.lua"?
sfan5 wrote:Geany is good
But there is a solution! 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.
sfan5 wrote:Geany is good
cornernote wrote:awesome work!
1 thing i noticed.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
But there is a solution! 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.
You should change chess to tutorial.
tonyka wrote:Geany is the best in linux
Bluefish is also very good, but this is designed for web development, also has support for Lua...
Calinou wrote:tonyka wrote:Geany is the best in linux
Bluefish is also very good, but this is designed for web development, also has support for Lua...
Personally I use Mousepad - (Xfce's [too simple] text editor, and there doesn't seem to be any better solution for Xfce); gedit is a GNOME application, so it doesn't work well... I'm not a fan of text-based editors too.
Jordach wrote:Calinou wrote:tonyka wrote:Geany is the best in linux
Bluefish is also very good, but this is designed for web development, also has support for Lua...
Personally I use Mousepad - (Xfce's [too simple] text editor, and there doesn't seem to be any better solution for Xfce); gedit is a GNOME application, so it doesn't work well... I'm not a fan of text-based editors too.
Gedit works fine in XFCE.
Tried and tested. :)
Users browsing this forum: No registered users and 7 guests