Skip to player
Skip to main content
Search
Connect
Watch fullscreen
Like
Bookmark
Share
More
Add to Playlist
Report
Luanti Curriculum: Our First Mod (Lesson 02)
Minetest Videos
Follow
3 months ago
Time to start coding and make our very first mod. It won't be anything huge or fancy, but building a pyramid starts with moving a grain of sand.
Download Luanti: https://www.luanti.org/downloads/
https://www.nathansalapat.com/LMC/02-first-mod
https://nathansalapat.com/SocialMedia
https://nathansalapat.com/support-me
Category
📚
Learning
Transcript
Display full video transcript
00:00
In this video, we'll be making our first mod.
00:04
As you can see, it's going to be pretty basic, just a full grass node and recipe.
00:08
The first step is to create a new directory in our mods directory for all the mod files.
00:12
We're going to call our first mod grass, so we'll create a directory called grass.
00:16
This mod is going to be very basic, so we're only going to need two files,
00:20
init.lua and mod.conf.
00:24
You can create these in the file browser or in the code editor.
00:28
I'm going to open the project directory in Pulsar and create the two new files.
00:33
init.lua will hold the actual code for the mod.
00:36
mod.conf stores some configuration data that tells Luanti about the mod.
00:40
Every mod will need, at very least, these two files.
00:43
We'll take care of the mod.conf file first.
00:46
Luanti expects a few different bits of data.
00:49
A name, title, description, dependencies, and an author.
00:53
The name is the internal name of the mod.
00:55
All nodes and items will be named with name colon something.
00:59
The title is a human-friendly name and will be displayed in the mod selection dialog in Luanti.
01:05
For this mod, we'll just use grass for both.
01:07
The description is a short sentence explaining what the mod is, does, adds, etc.
01:12
Dependencies tell Luanti what your mod needs or can use.
01:16
We'll cover them more in a later video.
01:19
This mod will only depend on default.
01:21
Lastly, the author should be set to your content database username if you have an account there.
01:26
Now, onto writing some actual code.
01:28
We'll start with registering a new node called grass-grass.
01:32
Remember, every node in this mod needs to start with grass colon.
01:36
The description will be shown when hovering the node in most inventory screens.
01:45
The tiles are the textures that Luanti will render on the faces of the node.
01:50
If all the faces have the same texture, we only need to list the texture once.
01:54
We'll cover this more in a future video.
01:56
Groups can do many different things.
01:59
In this case, the crumbly group is needed for tools, so Luanti knows what tools should be able to break the node.
02:05
The soil group is used by other mods, but we'll just include it for compatibility.
02:10
When we break this node, we don't actually want to get back to full grass block, but rather dirt.
02:16
So, we'll tell the engine that on breaking, the node should drop default dirt.
02:21
We can do a lot more with the drop table, but we'll cover that more in another video.
02:26
This is a really basic node registration.
02:29
Nodes can have callbacks so that they're more interactive, but for the time being, this will suffice.
02:34
Right now, there is no way to craft this node.
02:37
We can get it via creative or using the give command, but it would be really nice to be able to craft it.
02:42
So, let's add a craft recipe.
02:44
This is structured a bit different than the node registration.
02:47
We use an output to say what the node or item is that's created.
02:52
The recipe is a table, and the default craft grid is a 3x3 square.
02:56
So, we have 9 items max we can use.
02:58
We need to know the item strings for each ingredient.
03:01
A blank entry just means the inventory slot should be empty.
03:05
How do we know the item strings though?
03:07
There are many different items in a game, and it would be nearly impossible to ever remember all of them.
03:12
The easiest way is to open Luanti, go into settings, click on the user interfaces heading on the side, and check the append item name option.
03:22
Now, if we launch a world with creative enabled, we can search for any item and hover on it in inventory to get the item string.
03:29
Some inventory mods will also give us this data without enabling this option.
03:33
We want to use grass and dirt to make the full grass block, but there are several different stages of grass in the game.
03:40
Thankfully, they all drop the same item.
03:43
So, we can just use default colon grass underscore one in the recipe.
03:48
Our recipe will be one dirt in the center, with one grass on top, right, bottom, and left.
03:54
Launching a world, with our new mod enabled, we can dig up some dirt, collect a bit of grass, and craft our new node.
04:03
Let's add another recipe, just for fun.
04:06
This recipe will just be one dirt and one grass.
04:09
Our table doesn't need to have two rows of blanks, so we can put the entire recipe on one line.
04:14
We'll just set our output to be default dirt underscore width underscore grass.
04:19
Mods can make recipes for nodes that other mods provide.
04:23
We just need to make sure that the other mods we want to use items from are listed in our dependencies in the mod.com file.
04:33
Well, that wraps this lesson up, but before you go, homework!
04:39
Add the other grasses to this mod, so we can craft full grass nodes of all the grasses, and make craft recipes for them as well.
04:47
There's a link to a completed mod on the related webpage.
04:52
Thank you!
04:53
Thank you, correct.
04:55
I'll show you all the instructions.
04:57
Don't know your instructions, so we can save the water and Geb Jay.
05:02
It's for the next page!
05:03
We can use the calculations of the behav.
05:04
You can use the neurologic entrar, so we can use the problem.
05:08
We can use the tools to make...
05:09
...we can use the brain as well.
05:11
We can use the dificultness of the system, and use the system.
05:14
The reason should be the next part, so we can use the system to control the system.
05:16
We can use the documentation and use the system.
05:17
The idea is 길 and need to understand those things.
Be the first to comment
Add your comment
Recommended
10:42
|
Up next
Luanti Modding Tutorial: Wear Bar Color
Minetest Videos
6 months ago
12:41
Luanti Mod Review: Astralcraft
Minetest Videos
6 months ago
10:10
Luanti Mod Review: Painting Gallery
Minetest Videos
4 months ago
13:39
Luanti Mod Review: Bonified
Minetest Videos
6 months ago
7:13
Luanti Mod Review: Placement Preview
Minetest Videos
6 months ago
16:24
Luanti Mod Review: Pick and Place
Minetest Videos
6 months ago
16:41
Luanti Mod Review: X Obsidianmese
Minetest Videos
7 months ago
14:26
Luanti Mod Review: Item Replicator
Minetest Videos
4 weeks ago
6:32
Luanti Mod Review: Skinsdb
Minetest Videos
5 weeks ago
12:54
Luanti Mod Review: LWRoad track
Minetest Videos
6 weeks ago
10:42
Luanti Mod Review: Best Lobster
Minetest Videos
7 weeks ago
8:45
Luanti Mod Review: Blackhole Containment Box
Minetest Videos
2 months ago
20:42
Luanti Mod Review: Wilhelmines Marinara
Minetest Videos
2 months ago
7:43
Luanti Mod Review: Basket
Minetest Videos
2 months ago
10:57
Luanti Mod Review: Elly's Flowers
Minetest Videos
3 months ago
17:49
Luanti Mod Review: Gooey Mess
Minetest Videos
3 months ago
4:06
Luanti Modding: 01 Intro
Minetest Videos
3 months ago
14:12
Sudoku: A Luanti Game
Minetest Videos
4 months ago
9:44
Luanti Mod Review: Trowel
Minetest Videos
4 months ago
32:08
Luanti Mod Review: Infinity Gauntlet
Minetest Videos
5 months ago
9:13
Luanti Mod Review: Ore Deposits
Minetest Videos
5 months ago
10:28
Luanti Mod Review: Dungeons Plus
Minetest Videos
5 months ago
11:45
Luanti Mod Review: Horror
Minetest Videos
6 months ago
0:51
Former Aide Claims She Was Asked to Make a ‘Hit List’ For Trump
Veuer
2 years ago
1:08
Musk’s X Is ‘the Platform With the Largest Ratio of Misinformation or Disinformation’ Amongst All Social Media Platforms
Veuer
2 years ago
Be the first to comment