Week 2 Challenge: Dig into the Code
This week we will dig a little deeper into modding by setting up a basic file/folder structure for our class mods. Ideally, by the end of this lesson you will have made your first node (block for the game. Don't worry if you don't completely finish it, or it looks a little rough. You can go back and inprove your creation later.
Things you should know by the end of this challenge:
- Minetest mods are written in a programming language called Lua.
- Mods usually have common set of files and folders with the same names.
- What is the basic process for creating and registering a new node (block or item that can be placed in the game)
This Week's Challenge!
(1)Set up the folder/file structure for your mod in the appropriate folder on your flashdrive using Ruben Wardy's Minetest Modding Book to help you. You may name your mod "mymod" or any name you would like. We can change the name later. At a minimum your mod folder should contain the following files/folders:
- folder named "textures"
- README.md (Use JEdit or any text editor to write your name and description of your mod in this file.)
For now, it is okay that most of your files and folders are empty. We will fill them with code and pixel art textures later :)
(2) Register a new node for Minetest. A node is a basic block or item that you can place in your world. Use Ruben Wardy's Minetest Modding Book to guide you through this process. You will need to make at least one 16*16 pixel .png texture for your block. You can use Piskel to design your first node. Once your node is properly registered, and your mod is enabled, it should show up in the creative inventory.
(3)Register a craft for your node. After you successfully register a node it will show up in creative mode, but you will now need a way for you node to be crafted in survival mode.
Advanced: Review Wardy's chapter on node drawtypes and experiment with creating a new type of node that you have not created before.