Page 1 of 1

I want to start modding

Posted: Thu Nov 07, 2013 20:14
by Thyrrac
FIRST OF ALL
HEYHO FORUMS!!! :D
-------------------------
Yeah as the title says... I wanna start writing mods. I have good knowledge about Java but I think that wont help me here ;D The mods are written in lua, am I right? So I decided to learn LUA but I have the following questions:
1. How do I start creating mods?
2. Are there mods where I can look at to learn?
3. How about Multiplayer-mods... is there a difference between Single Player and Multiplayer mods?

I hope someone can answer me :P

Posted: Thu Nov 07, 2013 20:25
by Evergreen
Thyrrac wrote:FIRST OF ALL
HEYHO FORUMS!!! :D
-------------------------
Yeah as the title says... I wanna start writing mods. I have good knowledge about Java but I think that wont help me here ;D The mods are written in lua, am I right? So I decided to learn LUA but I have the following questions:
1. How do I start creating mods?
2. Are there mods where I can look at to learn?
3. How about Multiplayer-mods... is there a difference between Single Player and Multiplayer mods?

I hope someone can answer me :P
There is no difference between sp and mp mods.

Posted: Thu Nov 07, 2013 20:38
by Jordach
https://github.com/Jordach/Minetest-Mod ... l/init.lua

This mod probably doesn't work anymore, but this shows how one should form basic nodes and crafting recipes.

Posted: Thu Nov 07, 2013 23:52
by philipbenr
Just take a look at nodes.lua in /minetest_dir/games/minetest_game/mods/default. That is if you have the latest, 0.4.7. You can look stuff up what you don't understand in the developer wiki: ex: http://dev.minetest.net/minetest.register_node

Posted: Thu Nov 07, 2013 23:52
by philipbenr
That is the best way to start. I think.

Posted: Fri Nov 08, 2013 00:31
by general3214
Just like you, I started with Java (from Minecraft modding), but realized that Lua is quite similar to Java. After looking at the .lua files in minetest\games\minetest_game\mods\default, I started modding right away. Once you get started, you'll see the similarities and how easy it is to mod Minetest.

Posted: Fri Nov 08, 2013 13:25
by sfan5
http://sfan5.duckdns.org/minetest-moddi ... ishEN.html
That is the english version of a modding tutorial Jeija wrote.

Posted: Fri Nov 08, 2013 14:07
by rubenwardy
I wrote most of that.

Posted: Fri Nov 08, 2013 15:18
by jin_xi
Evergreen wrote:There is no difference between sp and mp mods.
actually, it does take some care to make sure a mod you're developing in singleplayer mode does indeed work as intended when used on a server with many players, but this depends on what your mod does.

Posted: Fri Nov 08, 2013 15:29
by Evergreen
jin_xi wrote:
Evergreen wrote:There is no difference between sp and mp mods.
actually, it does take some care to make sure a mod you're developing in singleplayer mode does indeed work as intended when used on a server with many players, but this depends on what your mod does.
He is used to mod in minecraft, where they have to have entirely different versions just to work in mp

Posted: Fri Nov 08, 2013 18:21
by PilzAdam
sfan5 wrote:http://sfan5.duckdns.org/minetest-moddi ... ishEN.html
That is the english version of a modding tutorial Jeija wrote.
Better use http://dev.minetest.net/Intro, its based on Jeijas tutorial but more up-to-date.

Posted: Sat Nov 09, 2013 20:27
by zackscottl
Hey :) I just started modding too, but I can help. LUA is an OO (Object oriented language.) To make a node (block, tool, etc), type a code looking like this:

Code: Select all

minetest.register_node("mod:nodename_here", {
     description = "node",
     tiles = {"tile1.png"},
     groups = {cracky=3},
})
if you have any questions, ask me or anyone else :)

Posted: Sun Nov 10, 2013 11:40
by Thyrrac
Hmmm yes registering a node is not that hard. But my aim is to write a mod which implements 3D Mobs. So I need models, textures and code to implement it. The only thing I still need is the code at the moment. Now I am trying to write a code for a simple block-mob but I am really bad :D I try to handle Lua Entitys and spawn them with minetest.add_entity() but it doesn't work. I have read the wiki and the only thing I found was a reference to item_entity.lua so I read the code and , as I said, tried that to code a block-mob. Result: Error Code :D So can anyone help me?
I don't want a "How To" Tutorial where I only have to copy and paste I want another reference or something similar like a mod or a Lua Script in the default game to analyze it on my own and find out how it works. Does anyone know something like that?

Posted: Sun Nov 10, 2013 11:57
by fairiestoy
What about using the forum search engine? There is a good amount of mob mods to analyze. So enough material to learn from.

Also would it be nice if you post the error code if you have any. Otherwise one cannot know what error you have and how to help you. Should be in the console and in debug.txt.

Posted: Sun Nov 10, 2013 19:35
by SegFault22
You could just steal code snippets from other mods, for blocks/items/etc., and repurpose them (for example, taking the code for a silver lump from MoreOres, and changing it to register a different lump for your mod). It is much better to use your time being creative and designing the mod's stuffs, than studying LUA and going through trial/error with scripts.
So long as you include no original content from the mods you got the code from, it is perfectly fine and you don't have to use a specific license or give specific credit to anyone - because that code you repurposed would be exactly the same as if you were to learn LUA and write it. And all code pieces, for example, item registry, in all mods that use it, have the same basic properties/parts, just different parameters.

Mobs are a different thing, and most of the code that registers and controls them is unique, so I suggest that you don't steal that from another mod, as there is no built-in registry for mobs/AI, only entities, and that would be original content from the mod you got it from.

Posted: Mon Nov 11, 2013 02:24
by hoodedice
SegFault22 wrote:You could just steal code snippets from other mods, for blocks/items/etc., and repurpose them (for example, taking the code for a silver lump from MoreOres, and changing it to register a different lump for your mod). It is much better to use your time being creative and designing the mod's stuffs, than studying LUA and going through trial/error with scripts.
Plagiarism. But then again, I think that's the best way to do it.