Modding Tutorial Book (new: Code architecture, unit testing)

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Inventories)

by rubenwardy » Post

You're welcome.
Also, I forgot to announce:

New chapter available, "privileges": http://rubenwardy.com/minetest_modding_ ... leges.html

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: Modding Tutorial Book (new: Privileges)

by ExeterDad » Post

Funny this topic came up today. My ten year old son wanted me to teach him how to make a mod to add new blocks to Minetest. I referred him to your book this afternoon to learn a thing or two before I just coded it for him. He read for quite awhile. The fact it held his interest for that long tells me things were sinking in, and not too boring.
Well done... and Thank you.

Godo
Member
Posts: 20
Joined: Mon May 02, 2016 06:41
In-game: Godo

proofreading

by Godo » Post

Hi, rubenwardy. First of all thank you for all the hard work that went into writing the modding book, I have found it quite interesting and useful. Unfortunately, I haven't got the time to pursue it to its farthest limits, but it has helped me understand a lot about how textures work within Minetest.

One thing I miss is an explanation of how you make the background transparent using the Gimp. I use a different program to edit the pixels in .gif, then open it with the Gimp and save it as .png, but although I managed to adjust the paintbrush and eraser sizes following your instructions I haven't been able to figure out how to do the transparency bit (the help section in the Gimp was not very helpful: I managed to add an alpha channel and select the background in the image, then I tried all four options in the transparency menu option, but I couldn't see any changes to the background with any of them).

In the end I managed to do it using another program (a litlle freeware jewel called Giffy whose main function is basically to set a transparent background to a .gif image), then saving it as .png with the Gimp. But all the same, could anyone tell me how to make the background transparent using the Gimp?

One more thing: I have come across some language mistakes which you might want to correct. They are detailed below.

README.html
... which is understandably
---> ... which is understandable.

chapters/folders.html
a good mod name can describes what the mod does.
---> a good mod name should describe what the mod does.

chapters/lua.html
Nil means not initalised. The variable hasn’t been assigned a variable yet
---> ...hasn’t been assigned a value yet

chapters/nodes_items_crafting.html
or they can be used be the player
---> or they can be used by the player
Item definitions like seen above...
---> Item definitions like the one seen above...
... are usually made up of an unique item string
... are usually made up of a unique item string
Last edited by Godo on Sat Jun 04, 2016 20:19, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

Most of those typos have already been fixed, where are you reading the book from?
Added "explanation of how you make the background transparent using the Gimp" to the todo list.
The answer is to right click the layer and select "add alpha channel" or something like that, then use the rubber to erase.

Godo
Member
Posts: 20
Joined: Mon May 02, 2016 06:41
In-game: Godo

proofreading

by Godo » Post

I have been reading the "offline" version of your book, which I downloaded two days ago.

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

I forgot to upload a newer version of that, but I've just uploaded one now. (the one you downloaded is from november)

Godo
Member
Posts: 20
Joined: Mon May 02, 2016 06:41
In-game: Godo

signlike nodes

by Godo » Post

Thank you so much, rubenwardy.

I see you have added a section about privileges, I'm going to read that (not now, thought, it's bedtime). When you have nothing better to do, could you finish the section about signlike nodes in the chapter about Node Drawtypes? When I started reading your book I was hoping to find a way to craft wooden arrow signs, to avoid getting lost as I explore (as a newbie, that was one of the first problems I encountered). I know I can use /sethome and all that, but it feels like cheating, doesn't it?

I'm uploading the signpost I was working on before deciding it was out of my depth, in case someone out there learning to do mods wants a challenge.

What I am doing in the meantime is this: I've changed the texture of the wooden sign to give it the shape of an arrow pointing left. When I want to point the way to an interesting feature in my world, I put two blocks of stone one of top of the other, then I nail the sign on the top one with the arrow facing in the direction I want to indicate. Sometimes I use several signs on different sides of the stone signpost, because they all point to the left. Instead of stone blocks you can use three pieces of wooden fence one on top of another, they look nicer, but if you don't put a sign in each of the four sides there is a problem: the sign points in opposite directions when seen from opposite sides. I am also uploading the texture I have changed. It would be nice to have another one pointing right, but I would need to sacrifice the iron sign for that.
Attachments
default_sign_wall_wood.png
modified texture for wooden wall sign
(1.03 KiB) Not downloaded yet
arrow_sign_left.png
Wooden singpost (pointing left)
(395 Bytes) Not downloaded yet

Godo
Member
Posts: 20
Joined: Mon May 02, 2016 06:41
In-game: Godo

Back again with an example

by Godo » Post

Hi, rubenwardy, it's me again. In the end I couldn't resist putting your wonderful tutorial to the test. I have managed to write a couple of mini-mods (for a washing-machine and a bedside table) and I am trying for a slanted straw roof (having a bit of a hard time with that, but it's fun).

(By the way, I came across another couple of typos in your tutorial (chapters/node_drawtypes.html):

Each row is a cubiod... --->
Each row is a cuboid...

... which are joined to make a single node. --->
... which is joined to the others to make a single node.
Last edited by Godo on Tue Jun 28, 2016 19:13, edited 1 time in total.

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: Modding Tutorial Book (new: Privileges)

by KCoombes » Post

Chapter suggestion: Biomes and how to create them. I'm currently dissecting TenPlus1's Ethereal mod for his biome generation code, which is marvelously commented, but explanations of each definition entry would be helpful.

User avatar
TumeniNodes
Member
Posts: 2860
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Modding Tutorial Book (new: Privileges)

by TumeniNodes » Post

Maybe more info regarding "meshes"?
I am not sure if you have updated it, but if so I have not found it. I think it is one of the area under types of nodes which is yet to be finished?

I had received a pm from a new user a week ago asking if I knew of any info regarding graphics (how to make changes to the UI, etc.
I would like to offer any help I could give toward this if needed? In regards to textures, UI graphics and even how to make changes to the interface (as I dig into it to see what is what and how to) etc.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: Modding Tutorial Book (new: Privileges)

by KCoombes » Post

Chapter 12 Formspecs: Other Elements

You should look in lua_api.txt for a list of all possible elements, just search for “Formspec”. It is near line 1019, at time of writing.

It is now at line 1376.

User avatar
TumeniNodes
Member
Posts: 2860
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Modding Tutorial Book (new: Privileges)

by TumeniNodes » Post

KCoombes wrote:Chapter 12 Formspecs: Other Elements

You should look in lua_api.txt for a list of all possible elements, just search for “Formspec”. It is near line 1019, at time of writing.

It is now at line 1376.
Thank you.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: Modding Tutorial Book (new: Privileges)

by KCoombes » Post

Help please?

In the Lua Modding API Reference page, you have this:

drop = {
max_items = 1, -- Maximum number of items to drop.
items = { -- Choose max_items randomly from this list.
{
items = {"foo:bar", "baz:frob"}, -- Choose one item randomly from this list.
rarity = 1, -- Probability of getting is 1 / rarity.
},
},
},

As this is written, my node is dropping 1 of each item, not 1 single item. Any advice?

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

I did not write that, as the page says at the top. It's just a nicely formated version of the official docs. I'm not sure how it works, please seek support through normal means

User avatar
Wuzzy
Member
Posts: 4046
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Modding Tutorial Book (new: Privileges)

by Wuzzy » Post

In your guide, can you please also link to http://dev.minetest.net/Mod_interoperability and http://dev.minetest.net/Groups in the appropriate places?

The first page is written to improve interoperability and general collaboration between mods in the hope to reduce redundancy and confusion. It mostly lists API mods. The second page lists known groups.

You are also invited to improve said pages by yourselves. ;-)
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Modding Tutorial Book (new: Privileges)

by MineYoshi » Post

Somebody talked about translating this Modding Tutorial Book?

Because i would like to translate this to spanish...
(Now that I have the idea)
Oi

DraggonFantasy
New member
Posts: 7
Joined: Tue Aug 02, 2016 12:51
GitHub: DraggonFantasy
IRC: DraggonFantasy
In-game: DraggonFantasy

Re: Modding Tutorial Book (new: Privileges)

by DraggonFantasy » Post

MineYoshi wrote:Because i would like to translate this to spanish...
I can also translate it to russian :) if I'll not be lazy
But the only bad thing in translations is that they often get outdated very quickly. When there's only 1 version of book (english) - it's needed to maintain only 1 version. But when there are spanish, french, russian etc, then you need to maintain 100500 versions.

Btw, I noticed a little mistake in "Inventories" chapter, "List sizes" part in example code:

Code: Select all

print("size:  " .. inv.get_size("main"))
But AFAIK, it should be:

Code: Select all

print("size:  " .. inv:get_size("main"))

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Modding Tutorial Book (new: Privileges)

by MineYoshi » Post

I can maintain the version updating it every week...

Isn't that hard when one person has to care only about one translation!
Oi

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: Modding Tutorial Book (new: Privileges)

by muhdnurhidayat » Post

Since the owner says that this is not ready for translated yet (and so no support for translation yet)...

What if we forked the book and translate it? I think there's a way to get notified whenever the main repo get new merge/new update... then we can update the translation manually in our translation forks?
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

It's ready for translation, I'm just not sure how it should be done

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: Modding Tutorial Book (new: Privileges)

by muhdnurhidayat » Post

If it is jekyll, maybe this can give some idea on how to do the translations?

http://chocanto.me/2016/04/16/jekyll-multilingual.html
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

muhdnurhidayat wrote:If it is jekyll, maybe this can give some idea on how to do the translations?

http://chocanto.me/2016/04/16/jekyll-multilingual.html
Done! https://rubenwardy.com/minetest_modding ... w-language

User avatar
rubenwardy
Moderator
Posts: 6244
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Privileges)

by rubenwardy » Post

Added the ability to convert the book into PDF form. You can download a PDF from here: https://github.com/rubenwardy/minetest_ ... k/releases

You can also download a zip file of the HTML version

User avatar
TumeniNodes
Member
Posts: 2860
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Modding Tutorial Book (new: Privileges)

by TumeniNodes » Post

PDF version is great to have rubenwardy, thank you.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: Modding Tutorial Book (new: Privileges)

by Stix » Post

ive been reading this book, and i must say that its very helpful for a beginner like me!
Hey, what can i say? I'm the bad guy.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests