Hello World

User avatar
Khyrberos
New member
 
Posts: 5
Joined: Sun Dec 29, 2019 04:33
GitHub: Khyrberos
IRC: Khyrberos
In-game: Khyrberos

Hello World

by Khyrberos » Sun Dec 29, 2019 04:41

Hello all, my name is Khyrberos is I'm interested in learning more about modding Minetest. I've been an active & modding member of the Warcraft III community for over a decade now (off-and-on) so I'm familiar with how some of this works, but I recognize I'm really starting off basically at Square Zero in most ways, so I appreciate your help & patience.

I've only recently been introduced to Minetest, but I've been a massive fan of Minecraft for years, and was elated to discover this free-ware, open-source version; especially because I've had an idea for a game kicking around in my head for years & have 'recently' realized that Minecraft itself was largely (the base, at least, of) what I was looking for... with some changes (kind of like a 'god-mode' Minecraft, focusing on manipulating an active environment & carving a path through history). Enter Minetest.

I've opened all the proper tabs (https://dev.minetest.net/Modding_Intro, https://rubenwardy.com/minetest_modding ... arted.html, etc) & I'm gonna start studying (though as busy as my life is, I'm not likely to get far anytime soon). I'll admit it's rather daunting. So I guess I'm just posting to kinda 'put my stake down' & throw out a hand for any guidance that can be offered.

Either way, I appreciate you taking the time to read through all this. : )
 

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

Re: Hello World

by Krock » Sun Dec 29, 2019 19:06

Hello and welcome to Minetest.

As always, copy&pasting someone else's code is a good start to get a bit into the modding structure. Try&error can be quite interesting at first, but if you'd like to know something that's not in the modding book or other tutorials feel free to ask your questions in the Modding forum. If you have luck (usually on the weekend), you can get answers quicker on IRC.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
v-rob
Member
 
Posts: 731
Joined: Thu Mar 24, 2016 03:19
Location: Right behind you.
GitHub: v-rob

Re: Hello World

by v-rob » Sun Dec 29, 2019 22:16

I personally learned Minetest modding (and Lua to boot) by complete trial and error with a tiny bit of help from the Developer Wiki (I don't suggest using that, I suggest the Lua API instead). So, I would suggest learning by looking at mods that do similar things to what you want and looking at their code and do a bunch of copying and pasting.
 

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

Re: Hello World

by Wuzzy » Mon Dec 30, 2019 11:31

Developer Wiki (I don't suggest using that, I suggest the Lua API instead).

As a major wiki editor, I can confirm.

Especially all the pages that reproduce function documentation in Dev Wiki are utterly outdated and should be deleted (but I'm not allowed to). There are still some useful pages (those that contain general advice), but you definitely have to ignore all pages that just repeat Lua API documentation.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
FreeGamers
Member
 
Posts: 503
Joined: Sat May 25, 2019 00:15
Location: United States
GitHub: is proprietary I use NotABug

Re: Hello World

by FreeGamers » Mon Dec 30, 2019 16:30

Welcome to the community Khyrberos and good luck with your project! The forums are a good resource for questions and feedback.
 

User avatar
Khyrberos
New member
 
Posts: 5
Joined: Sun Dec 29, 2019 04:33
GitHub: Khyrberos
IRC: Khyrberos
In-game: Khyrberos

Re: Hello World

by Khyrberos » Sun Jan 12, 2020 07:35

(finally getting back to this... Did I mention this might take me a while? lol...)

Krock wrote:Hello and welcome to Minetest.

As always, copy&pasting someone else's code is a good start to get a bit into the modding structure. Try&error can be quite interesting at first, but if you'd like to know something that's not in the modding book or other tutorials feel free to ask your questions in the Modding forum. If you have luck (usually on the weekend), you can get answers quicker on IRC.

v-rob wrote:I personally learned Minetest modding (and Lua to boot) by complete trial and error with a tiny bit of help from the Developer Wiki (I don't suggest using that, I suggest the Lua API instead). So, I would suggest learning by looking at mods that do similar things to what you want and looking at their code and do a bunch of copying and pasting.

Yes, I'd love to begin with simple stuff & definitely plan on utilizing the great glorious Copy-Pasta to get started... However I guess I could use some 'orientation' as to exactly how this all works.

See, in Warcraft 3 modding, you just open the 1st-party 'World Editor' program & you can immediately use the GUI to mess with object values, or begin making simple event-response code with little drop-down menus, and then instantaneously test it in-game with the click of a button.

However, none of that seems to apply here. What exactly is the modus operandi when it comes to Minetest? Is there any kind of "modding program"? Am I inspecting/modifying the Lua code via Eclipse (or the like), or simply Notepad++ (or the like)? How do I "install" a given set of code/mod and/or "create" my own compiled 'modpack', and most importantly what's a good way to test these/this mods? (also, I imagine it might be wise to have all of this stuff in it's own isolated set of folders, just for organization's sake; do I need to use the directory Minetest is installed in or can I put it elsewhere?) Anything else I should know/prepare myself for?


I appreciate your patience; I know these are real basic questions. Thanks!
 

User avatar
PolySaken
Member
 
Posts: 472
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: Hello World

by PolySaken » Fri Jan 17, 2020 11:12

I personally use notepad++ personally simply because of the autocomplete. There are a few dedicated IDEs that you can use but I find most text editors satisfactory.

I usually develop my mods right inside the 'mods' folder of my minetest installation, and clone them to a separate folder for release when a feature is ready.

To install a mod you just put the mod's folder inside the 'mods' directory, or make a new folder with a text document named 'modpack' inside the 'mods' directory and put them there.
the folder structure looks like this:
Code: Select all
/foo/bar/minetest/
  |- mods
      |- mod
      |- modpack
           |- mod
           |- modpack.txt


modpacks are essentially just fancy ways to group mods together.

To actually run the mod you need:
init.lua: contains the first code to run when your mod is loaded.
mod.conf: contains information about your mod, works as follows:
each line is a new setting. settings are denoted like <setting>=<value>
some examples:
Code: Select all
name=modname --this tells the engine what namespace your mod is using
description=lorem ipsum dolor... --this is shown to users in the content tab
depends=default,foo,bar --a comma separated list of the mods required to run this mod
optional_depends=foo,bar --similar to depends, a list of mods supported by this mod


technically you only need <name> but the others are pretty much required too.

some other files/folders that aren't really required are:
textures: a folder that holds all your images. as images can be accessed from anywhere, it is good practice to prefix them with your name or the modname.
sounds: a folder that holds all your sounds. same convention as with textures.
screenshot.png: an image that is shown next to the mod description.
license.txt: can actually be named anything, only required for publishing mods.
readme.md: stuff about your mod, useful for github.

the folder structure of a mod usually looks like this:
Code: Select all
/minetest/mod/
   |-textures                         
      |-modname_image.png
   |-sounds
      |-modname_sound.ogg
   |-init.lua
   |-mod.conf
   |-foo.lua
   |-bar.lua
   |-screenshot.png
   |-license.txt
   |-readme.md


to use your mod in a world, first create a world and then click configure. A menu will open allowing you to select which mods to enable. You can also create a folder in your world directory called 'worldmods' which will load when the world is run and allows you to create portable maps.

Another way to create custom content is to make a 'game' which is a collection of settings and mods that can create a wholly unique experience from other games in minetest. they show up along the bottom of the screen in the 'start game' tab of the main menu. I won't go into complete detail here as it would take too long.

some tips:
- split up your code into different files using the dofile() function (the path to your mod can be got via minetest..get_modpath("modname"))
- create a function for any code repeated more than twice, the API changes all the time.
- if something has the potential to conflict, it will. Use your namespace everywhere, and guard it well.
- mese is the ultimate plot device and the answer to any questions raised about the functioning of items/blocks in your mod.
 


Return to General Discussion



Who is online

Users browsing this forum: No registered users and 11 guests