Anyone wanna learn some Lua, make some easy changes to the mods?

I’m sure everyone has a ton of ideas, for example I want to add moreores items to the enchantment table, add some stuff to groups they should be in, little stuff but it can expand.

Maybe we can set up a time to meet on the chat (matrix prefered because it has history) and we can clone stuff and play around with it and submit pull requests

I got a ton of great idea, for example this.
My only problem that i can not code :frowning:

I currently have wood, stone, mithril and crystal tools, and all 3d_armor working in the enchanting table with protection, healing, fire resist, speed and jump enchants for armor. I just need to fix an issue rendering enchanted armor.

Multiple enchants per item isn’t possible. It would need to register a separate item for each combination of enchants.

1 Like

I decided it was easier to make a standalone mod since the xdecor author got mad about a change to 3d_armor and ripped out support. Putting an xdecor enchantment table in crafting grid will produce a new and improved enchantment table. The readme should cover all the changes…

It might be possible to add multiple enchantments to tools (but not armor) with set_tool_capabilities but I haven’t looked into it yet. Anyone want to choose colors to replace all the #bbbbbb colors in enchants.lua, or balance out the enchants in config-SAMPLE.lua?

Why does he / she “got mad about a change to 3d_armor”?
Sadly, I did not learn about lua yet - but I like the idea of upgrading the enchantment table very much.

@Dirk The removal comment is at https://github.com/minetest-mods/xdecor/issues/81#issuecomment-335266399

Anyway, I did some material and enchantment balancing and code changes to reduce the memory used by the mod. It was 783kB with 152 tools and 547 armors. It is now 310kB with 76 tools and 178 armors. And it starts up in almost half the time now.

For anyone learning lua, I recommend reading https://www.lua.org/gems/sample.pdf for tips to avoid mistakes that cause the code to be slower or use more memory than it needs to.

If you are learning modding I like this modding book https://rubenwardy.com/minetest_modding_book/en/index.html It does assume you know some lua though

Merge requests are more than welcome - especially around that time, where a lot of things want to be fixed due to mod updates and i can not bare enough time for doing everything as quickly as we’d all like :innocent:

@Milan The repo has hud and hudbars, and I tried to fix them a week ago. The /mods list doesn’t even show hud, maybe remove it from repo if not used. I installed hudbars and sprint (had to get player_monoids from https://github.com/minetest-mods/player_monoids because it wasn’t linked in the illuna repo) and they worked fine. Does the server have any changes that aren’t in the repo? Or any other mods that would interact with the hud?

@Milan I also just checked the irc mod and it didn’t duplicate messages. Your fork is a few commits behind but I didn’t have them so they probably won’t help. Do you have any changes that aren’t in the repo?

I am not sure what hud mod you are talking about - yes some mods are in worldmods/ but no important ones in our case:

automappercolors --for mapping
boats --so there is less headache updating minetest_game from upstream
clean --this just cleaned up some horse entities a while ago
external_cmd --so i can run ingame commands from the commandline
farming --same as boats
ghost -- be scared
mapfix 
mini_sun -- *psst*
mobs_fish
mobs_more_animals
mob_ostrich -- we should fix this thing some day
moreblocks_saw_registration --i think this was a user contribution for scifi nodes
mr_goat
munin
remove_unknown
track_players -- be scared
trick_or_treat -- hm. i should add this to the subgame 
vector_extras

however, i’ve added a bunch of them to the subgame, lately as you may have noticed, those are just some less relevant leftovers - almost all, if not all of the mods added as submodules to the game have been updated / received a merge from upstream.

i can reproduce the duplicate messages on my machine with archlinux - i couldn’t set up irc on windows

Is this not what the server is running?

it is, and this is the correct branch of the subgame https://git.tchncs.de/Illuna-Minetest/minetest_game/tree/technicworld

and if ur signing up, i can grant you a bit more access :slight_smile:

There however is hudbars, yes, but no mod called just hud…

What is the correct way to install the subgame? I cloned it with --recurse-submodules into ~/.minetest/games and then changed to the technicworld branch. But a few mods failed because I didn’t enter tchncs.de or github credentials. Many of the mod directories were empty and I was able to checkout/fetch the ones that had .git files but there are still a lot of empty directories.

cd .minetest/games/
git clone --recurse-submodules https://git.tchncs.de/Illuna-Minetest/minetest_game.git
cd minetest_game/mods
git checkout technicworld
rm my_door_wood my_future_doors # ../modpacks/mydoors is empty
for f in *; do (cd $f ; if [ ! -f "init.lua" -a -f ".git" ]; then git checkout -- ; git fetch ; fi); done

But it fails to load with the following error:

2020-03-17 17:38:02: WARNING[Main]: Mod name conflict detected: "bushes"
...
2020-03-17 17:38:02: ERROR[Main]: ModError: Unresolved name conflicts for mods "poisonivy", "bushes_classic", "bushes", "ferns", "molehills", "flowers_plus".

No:

git clone https://git.tchncs.de/Illuna-Minetest/minetest_game -b technicworld --recursive

but you won’t be able to checkout all mods, because some are login-only atm for various reasons (not that i liked to do this). Please create a gitlab account, so i can grant you more access

Created, same name as this forum account.

git config --global credential.helper store should help you, otherwise you’d have to type your credentials many times on clone

(you could also use an ssh key)

I don’t remember the order of hudbars but this fixes it. Armor and health on left and air, hunger, sprint on right.

diff --git a/hudbars/init.lua b/hudbars/init.lua
index 752608a..fa4160f 100644
--- a/hudbars/init.lua
+++ b/hudbars/init.lua
@@ -115,7 +115,7 @@ if sorting ~= nil then
 	end
 else -- swapped health & breath around and added hunger & armor
 	--hb.settings.sorting = { ["breath"] = 0, ["health"] = 1, ["hunger"] = 2, ["armor"] = 3 }
-	hb.settings.sorting = { ["health"] = 0, ["hunger"] = 1, ["armor"] = 2, ["breath"] = 3}
+	hb.settings.sorting = { ["health"] = 0, ["sprint"] = 1, ["armor"] = 2, ["satiation"] = 3, ["breath"] = 5}
 	hb.settings.sorting_reverse = {}-- [0] = "breath", [1] = "health"}
 end

The chat3 mod is causing the duplicate irc messages. The irc mod sends the message once in callback.lua minetest.register_on_chat_message(), and the chat3 mod then sends it once for every player online in init.lua minetest.override_chatcommand(). Which explains why the number of dups varies.

The solution is to move the irc.say for /me out of the player for loop and remove the irc.say for normal messages.

diff --git a/init.lua b/init.lua
index c605278..7a69d9b 100644
--- a/init.lua
+++ b/init.lua
@@ -149,9 +149,6 @@ function chat3.send(name, msg, prefix, source)
 			end
 
 			minetest.chat_send_player(rname, send)
-			if minetest.get_modpath("irc") then
-				irc:say(string.format("<"..name.."> "..msg))
-			end	
 		end
 	end
 
@@ -236,9 +233,9 @@ if minetest.chatcommands["me"] then
 				if not ignore or not chat3.ignore.is(rname, name) then
 					minetest.chat_send_player(rname, "* "..name.." "..param)
 				end
-				if minetest.get_modpath("irc") then
-					irc:say(string.format("* "..name.." "..param))
-				end	
+			end
+			if minetest.get_modpath("irc") then
+				irc.say(string.format("* "..name.." "..param))
 			end
 		end,
 	})
2 Likes