Best strategy to learn both Lua and Minetest modding?

Post Reply
InterPotato
Member
Posts: 65
Joined: Fri Jun 07, 2024 15:38
Location: Poland

Best strategy to learn both Lua and Minetest modding?

by InterPotato » Post

As in title. I would really like to create my own sandbox/open world/roleplay/whatever game, as well as some adventure plot line games. It may be a mid effort visually (I'm pretty good at graphics in paint.net, but terrible in modelling), also I have couple ideas, but that's not a topic of this post.

What I mean is that I would really like to learn both Lua and Minetest API as soon yet effective as possible. I don't personally have time to do this, I have other hobbies anyway. The problem is that the info is messy yet easily accessible, I just need a good course for Lua (please not video one), and basically that's it, since rubenwardy's modding book is a masterpiece, many communities deserve to have something like this. Oh, and a Blockbench tutorial too, it will be fully usable for MT when 5.10 cames out. I prefer Blockbench over Blender, I suck at 3D art, and I'm a rookie in traditional/graphic (like, comparable between a Kinemaster kid and a hobbyist paint.net creator, more into the latter tho), but blocks make this slightly better.

Also, any good sources for images and music that can be used in these forums? Will Kevin MacLeod and Unsplash cut it? I usually don't care about GPL/CC license, so that's why I'm asking.

Do you have any ideas?
I'm only human, after all...

User avatar
Blockhead
Moderator
Posts: 2249
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Best strategy to learn both Lua and Minetest modding?

by Blockhead » Post

Read, write & ask questions.

Read:
  • Find any mod you think is related to the problem you're trying to solve, and search in it for where it has the relevant info. I use grep/ripgrep on the command line, but you can search across multiple files in other editors like VSCodium. Some way to search a mod(/pack) or your entire extensive mod set is basically crucial.
  • Get yourself a downloaded copy of the Lua 5.1 Reference manual and have it open. Search it, browse through it. If you're not sure how to interpret it, google terms and functions that are in it for more info. Reference material is essential to any programmer. Also keep your Minetest lua_api.md open whenever programming.
  • Find and follow topical tutorial material like the modding book, Programming in Lua (just watch out for any advice that applies only to Lua 5.2 or later, Minetest is on 5.1 like most programs that use Lua, partly due to LuaJIT).
  • Learn about Computer Science topics as you need to, so that you have the ability to think outside of a specific language and framework (Lua and Minetest in this case).
Write:
  • Start with smaller projects or sub-projects and goals so you don't bite off more than you can chew. You can't churn out 105 biomes with 344 ores and 15 mobs overnight unless you just copied and pasted most of it.
  • Even if you think you don't have the complete answer, trying writing the code anyway. It may come out as you type. If the code isn't coming, just start by writing out what you want to do as comments, then use your reference material and googling to figure out the rest. StackOverflow can be quite helpful for general Lua problems, and these forums for Minetest-specific ones.
  • "Write one to throw away": A lot of people get stuck on their code being precious and aren't able to part with a particular implementation. Remember that the code in itself isn't the goal but the behaviour, the features, the content and so on - those are what you are aiming for. Periodically if you've improved you should be able to look back at your old code and say "This is bad, I could do it better now". Learning version control through git will also make it so you're always safe to revert to a working state if you really, really mess up.
Ask questions:
  • If you haven't worked out your problem and your constraints well enough to explain them to someone else, write that all out before you send someone a question. You may have just been flustered and needed to step back a bit.
  • Mostly, people want you to demonstrate that you did your research and weren't able to find a solution before you came to them.
  • Don't expect instant responses, even on Matrix or Discord. Thank people after they do respond, even if in the end they can't help you.
  • A lot of good info in this article as well.
For art assets, I don't know of any good sources for 3D models under CC licences, but for sound I suggest Freesound and for visuals OpenGameArt.org. You should also be aware that the geometry BlockBench puts out is not that good (this will affect framerate), and so you really want to be able to use Blender, you just have way better control in the latter.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

InterPotato
Member
Posts: 65
Joined: Fri Jun 07, 2024 15:38
Location: Poland

Re: Best strategy to learn both Lua and Minetest modding?

by InterPotato » Post

Very helpful, thx! I don't have a time for this now tho, due to both irl and hobbies (I have a very niche one, like so much niche, it's called "OS Mockups" or formerly "Windows Never Released/Never Released Operating Systems", they're not really into respecting any license tho, just like 99% of fan fiction). I also have couple other fandom hobbies too, but they're not really being developed now.
I'm only human, after all...

User avatar
Krock
Developer
Posts: 4683
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Best strategy to learn both Lua and Minetest modding?

by Krock » Post

Find something that's interesting to you, then copy&paste code. Find things out by try&error. It's not the most efficient way but you'll learn plenty while exercising.

Notepad++ also suffices to write mods, although linter support can be very handy to have to save a few seconds for each syntax mistake.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Astrobe
Member
Posts: 643
Joined: Sun Apr 01, 2018 10:46

Re: Best strategy to learn both Lua and Minetest modding?

by Astrobe » Post

I wrote an answer without reading the other answers and realized I wrote more or less the same thing. Can't delete the message entirely; consider this as an upvote of Krock's and Blockhead's answer.
My game? It's Minefall.

Post Reply