Saturday 18 February 2017

Getting Started with Mod of minetest

Hello everyone, today I bring you a post a little different, we will talk about how to create a mod in a video game, I made some mods for games to have some fun but I always found the first difficult approach this because every game uses the own rules as regards the programming. I wanted to take a tutorial of one of my mod but I saw that the post was very long and very boring. Turning on the internet I found an open source video game with a few basics of programming is easy intuition to all those who want to start creating mod. the video game is called Minetest and many call it the bad copy of Minecraft but that there should scandalize is better than I thought and once having learned to create a mod of Minetest am sure that you will create it even on Minecraft with some forethought more but the base is always the same. but I do not will write too so we start !!!




  • Necessary materials:
  1. First thing to do is install the game then go to this link:   minetest downloads.
  2. You will need a programming editor compatible with the game I use Geany : link geany.
  3. 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 },
})


These lines code are the core. With these few lines of code we can create a block in Minetest.

-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:woodHere 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.
-Fourth line

  • 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 !!!

ABR








No comments:

Post a Comment