Page 1 of 1

How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 17:39
by leeminer
I'm a beginner programmer, I know a little c++, javascript, python etc. I've been to the dev page on objects and methods etc. It feels like putting together a puzzle, it took me awhile just to figure out how to change the gravity, jump height etc.

My question is this. Is there an easier way to learn how to mod minetest? How did you learn? I've only found one tutorial and this was very basic, on how to create notes and create a craft recipe. I really want to dig in and make some cool stuff but I feel like I'm stuck.

Any ideas or feedback or personal experience would help me greatly.

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 17:54
by rubenwardy
Lua API is the main reference. It, in theory, documents the whole API.

Read existing mods to see how they work - but be wary that their code might be low quality, take it with a pinch of salt.

It depends on what you want to create. Come up with an idea, and try and research how to implement it. Start small. If you want to make nodes, tools and craftitems, look here in LuaAPI for descriptions of the stuff in {} in minetest.register_node.

I started writing a book on making mods for Minetest - learn in 24 hours style thing - but I stopped due to low interest (it isn't requested much)

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 18:00
by leeminer
rubenwardy wrote:Lua API is the main reference. It, in theory, documents the whole API.

Read existing mods to see how they work - but be wary that their code might be low quality, take it with a pinch of salt.

It depends on what you want to create. Come up with an idea, and try and research how to implement it. Start small. If you want to make nodes, tools and craftitems, look here in LuaAPI for descriptions of the stuff in {} in minetest.register_node.




I may be looking at it the wrong way but to me looking at the API interfaces via the LUA API is like learning Russian from a Russian dictionary. I guess what I really want is more of an instructional book on how components work and examples.

For example, I want to add a script to add 10 items to my inventory. Where would I look in the API. How would I logically figure this out without digging through other mod examples etc?

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 18:12
by rubenwardy
Then you need the invref of the player: inv = player:get_inventory()Lua API

or inv = minetest.get_inventory({type="player", name="celeron55"})
InvRef documentation

Use inv:add_item(listname, ItemStack("default:dirt"))
(I am just looking up listname, there is no explanation)

The documentation could be a lot better.

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 18:15
by Don
rubenwardy wrote:I started writing a book on making mods for Minetest - learn in 24 hours style thing - but I stopped due to low interest (it isn't requested much)

I would be interested in a book like that.

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 18:16
by Don
Might I suggest that you change the title to minetest instead of minecraft?

Re: How to learn minecraft moding?

PostPosted: Tue Dec 09, 2014 18:23
by Krock
Don wrote:Might I suggest that you change the title to minetest instead of minecraft?

Eww. I almost wanted to say

I don't know how to mod minecraft. Go to the minecraft forums and ask there

before I saw your message :)
rubenwardy already said good sites and there's one more: Dev wiki

Re: How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 18:39
by leeminer
Thanks, yeah, confused since my kid wants minecraft and my nephew so its on my brain too. But I love Minetest for the modding. Well, once I become an expert I will write some tutorials. Makes no sense to have everyone learn scripting as if it were a detective movie. Find this function, how does it work? Look for examples in other mods etc etc. Minetest mods for dummies anyone ;) lol

Re: How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 19:22
by pandaro
A good tutorial, in my opinion, is the best idea.
If it'll make accessible via github I could contribute, too.

Re: How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 19:28
by Krock
leeminer wrote:Look for examples in other mods etc etc.

It was a great help for me to look at the source of some simple mods. If they are good coded, it's easy to understand what the single functions do.

Re: How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 19:44
by Don
Krock wrote:
leeminer wrote:Look for examples in other mods etc etc.

It was a great help for me to look at the source of some simple mods. If they are good coded, it's easy to understand what the single functions do.

Problem is how do people know what mods have good code. My mods might not be good at all but I don't know. I tried my best but I am no programmer. That's why we need good documentation

Re: How to learn minetest moding?

PostPosted: Tue Dec 09, 2014 19:49
by Evergreen
Like I suggested in another topic, we NEED a better introduction/tutorial. The current one just doesn't cut it. Also, if it becomes a thing, it should come with the mintest source so that it is necessary to update it when new functions are added. Take django's documentation for example.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 03:47
by leeminer
Evergreen wrote:Like I suggested in another topic, we NEED a better introduction/tutorial. The current one just doesn't cut it. Also, if it becomes a thing, it should come with the mintest source so that it is necessary to update it when new functions are added. Take django's documentation for example.



So what is the next step? What resources do we have? Do we even have a place to host the tutorial?

There is obviously a lot of knowledge spread amongst the community. This is definitely doable. It would make Minetest more accessable and make Minetest even more popular, in my opinion.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 06:37
by rubenwardy
I am going to kick start the documentation writing. It will be done in markdown. GitHub can host markdown websites using jekyll, so it could be available at rubenwardy.GitHub.io/minetest_doc etc.

I'll start this tomorrow using stuff I have already written.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 07:49
by leeminer
Found this for list name, seems cryptic to me.

"listname — The inventory list to which the item or items are being moved (e.g. "fuel", "dst", or "src" for a furnace in the default game). "

http://dev.minetest.net/Player

So far I understand that ItemStack is an object that can create a stack of items. This is used in the invRef object. The invRef object is created by the player object method like player:get_inventory()

Its a bit like legos except I don't know where part A fits into part B or even where part B is... but sometimes I like a good challenge ;) Thanks goes to Rubenwardy for lending a helping hand on this.

I think what I've learned from this is follow the rabbit... start with the big object like player and work your way down... after all the player is what interacts with the world.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 13:29
by Evergreen
I think the tutorial should not be seperate from the main documentation. It should be included with the source. Although, it's fine to go ahead and write it before a PR is created.

Re: How to learn minecraft moding?

PostPosted: Wed Dec 10, 2014 13:45
by Linuxdirk
rubenwardy wrote:Lua API is the main reference. It, in theory, documents the whole API.

In reality it lacks a shitload of examples and descriptions and is an unorganized mess :(

I usually use a combination of lua_api.txt, the dev wiki, code of existing mods, and simply trying out what happens when I try to use a function.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 13:57
by Don
rubenwardy wrote:I am going to kick start the documentation writing. It will be done in markdown. GitHub can host markdown websites using jekyll, so it could be available at rubenwardy.GitHub.io/minetest_doc etc.

I'll start this tomorrow using stuff I have already written.

That is awesome. Thank you so much. This will help a lot of people including me.

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 17:32
by leeminer
The wiki that lists the objects and methods, each separate page has a discussion tab. Perhaps that would be of use????

Re: How to learn minetest moding?

PostPosted: Wed Dec 10, 2014 21:41
by Don
I think one of the problems is that people like me don't know enough to be helpful and the people who know enough are too busy with keeping the game progressing. I hope documentation gets better but I do appreciate all that has been done already.

Re: How to learn minetest moding?

PostPosted: Fri Dec 12, 2014 18:59
by Gael de Sailly
Great idea to make a modding toturiel. I've already thought of that, but I think my knowleadges in Minetest modding aren't sufficient, especially about mobs and inventories, so I can't make it myself.

But I can make a tuto about mapgen, it's a bit my specialty.

Re: How to learn minetest moding?

PostPosted: Fri Dec 12, 2014 20:48
by Don
Gael de Sailly wrote:Great idea to make a modding toturiel. I've already thought of that, but I think my knowleadges in Minetest modding aren't sufficient, especially about mobs and inventories, so I can't make it myself.

But I can make a tuto about mapgen, it's a bit my specialty.

A mapgen tut would be awesome. I need to learn so much more about it.
All I could do is a cut and paste tut.

Edit - copy and paste too

Re: How to learn minetest moding?

PostPosted: Sat Dec 13, 2014 16:25
by Gael de Sailly
There is just a little problem : my English is not very good.
I wrote:I've already thought of that

I've thought of a tuto in French.

So don't hesitate to report me my spelling mistakes. I need to improve my English, not just for Minetest.

Re: How to learn minetest moding?

PostPosted: Sat Dec 13, 2014 16:33
by rubenwardy
I would like people to work on translatng my book into other languages. Not yet, it is still in quite an unstable state.

Re: How to learn minetest moding?

PostPosted: Sat Dec 13, 2014 16:47
by Don
rubenwardy wrote:I would like people to work on translatng my book into other languages. Not yet, it is still in quite an unstable state.

I took a look at what you have so far. It looks awesome. It is clear and easy to read. I hope you continue it. It will help many people. Great work.

Re: How to learn minetest moding?

PostPosted: Sun Dec 14, 2014 21:46
by Gael de Sailly
Where can I find it ?

Re: How to learn minetest moding?

PostPosted: Sun Dec 14, 2014 23:08
by Don

Re: How to learn minetest moding?

PostPosted: Mon Dec 15, 2014 12:07
by Gael de Sailly
Thank you.
Looks interesting.
Not the time to read it completely today.