- Necessary materials:
- First thing to do is install the game then go to this link: minetest downloads.
- You will need a programming editor compatible with the game I use Geany : link geany.
- Knowledge of basic programming.
Today we will do something very simple we insert a new block (also called a node) in minetest. There are several types of blocks in minetest (as in minecraft) we create the easiest to understand how work.First of all we have to create the directory of your mod, in the mod creation rules of this game there is a default location that is required. So go inside the folder minetest then mod and create a new folder called "tutorial". the name of this folder is crucial because it will be used to internal program that soon we are going to do. After you create the folder tutorial Enter it in and create a new folder called "Texture" inside this folder we will put all textures we need for the creation of our mod. Inside the mod folder we create anew Geany file and call it int.lua this name is required otherwise minetest can not compile your mod.So the final path of the folders must be like this:
Now we open the init.lua file and the real fun begins!!!
First copy and paste these lines of code:
minetest.register_node("tutorial:wood", {
description = "wood",
tiles = { "tutorial_wood.png" },
groups ={ snappy=1,choppy=2,oddly_brekable_by_hand=2,flammable=3 },
})
-First line:
- minetest.register_node: this is the name of the function that gives us the opportunity to create a new block in the game, is obligatory and can not be changed.
- tutorial:wood: Here we declare the name of our mod (tutorial) which is the same name of the folder that we created earlier, if you want to change the name here you must also change the name of the folder. While wood is the name of the block that we will add in the game. paid attention to the syntax.
-Second line:
- description = "wood": This is giving small description of your block that appears in the game as a label.
-Third line:
- tiles = { "tutorial_wood.png" }: The tiles is the texture of your mod so thanks to this function, the program is able to load the texture. The texture must be placed in the textures folder, as you can see is a .png file type. You must call the texture in this format: nameofthemod _nameoftheblock.png in our case, as you can see we call it tutorial_wood.png. Now save this texture already created and put it in the texture folder: tutorial_wood.
- groups ={snappy=1,choppy=2,oddly_brekable_by_hand=2,flammable=3}: Inside of the group we have to put all the features of our block. We can find all the features inside of this link Groups.
Now save the file and try it out!!!
So open the game and create a new world,after you click configure and search in the list your mod just created (tutorial) select it and saved.
Finally, you start the game. Click the letter T on your keyboard and you will see a command window like this:
where you have to write this command line and press enter:
/grant singleplayer all this command gives you the privileges of Administrator of the world you've created.
After this command reclick T, write this other command line and press enter:
/giveme tutorial:wood 99 This command line would appear 99 blocks of our mod in our inventory.
Ok this basic tutorial on how to create a mod in minetest is over. If you want more tutorials like this let me know. And I'll see what we can do next time.
stay tuned !!!
Finally, you start the game. Click the letter T on your keyboard and you will see a command window like this:
where you have to write this command line and press enter:
/grant singleplayer all this command gives you the privileges of Administrator of the world you've created.
After this command reclick T, write this other command line and press enter:
/giveme tutorial:wood 99 This command line would appear 99 blocks of our mod in our inventory.
Ok this basic tutorial on how to create a mod in minetest is over. If you want more tutorials like this let me know. And I'll see what we can do next time.
stay tuned !!!
ABR
No comments:
Post a Comment