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

For anyone learning lua, I recommend reading 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 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 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
mini_sun -- *psst*
mob_ostrich -- we should fix this thing some day
moreblocks_saw_registration --i think this was a user contribution for scifi nodes
track_players -- be scared
trick_or_treat -- hm. i should add this to the subgame 

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

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 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
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".


git clone -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
 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"}

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)
 			minetest.chat_send_player(rname, send)
-			if minetest.get_modpath("irc") then
-				irc:say(string.format("<""> "..msg))
-			end	
@@ -236,9 +233,9 @@ if minetest.chatcommands["me"] then
 				if not ignore or not, name) then
 					minetest.chat_send_player(rname, "* "" "..param)
-				if minetest.get_modpath("irc") then
-					irc:say(string.format("* "" "..param))
-				end	
+			end
+			if minetest.get_modpath("irc") then
+				irc.say(string.format("* "" "..param))

Are you sure about this? The codebase is 8 months old and didn’t cause this issue before…

I don’t know why it is only a problem now, but the code clearly loops over all online players and calls irc.say for each one.

Is areas flak allowed/used? If not, the following will fix the hangglider issue in protections.

diff --git a/init.lua b/init.lua
index b284eba..b995287 100644
--- a/init.lua
+++ b/init.lua
@@ -152,15 +152,15 @@ hangglider.can_fly = function (pname, pos)
 			return (minetest.check_player_privs(pname, {protection_bypass=true}) or wardzones.checkPlayerZoneAccess(pname, zone) or not zone["data"]["no_fly"])
-	if areas and minetest.is_protected(vector.round(pos), pname) then
-		if hangglider.flak then
-			for id, area in pairs(areas:getAreasAtPos(pos)) do
-				if area.flak then
-					return false
-				end
-			end
-		end
-	end
+--	if areas and minetest.is_protected(vector.round(pos), pname) then
+--		if hangglider.flak then
+--			for id, area in pairs(areas:getAreasAtPos(pos)) do
+--				if area.flak then
+--					return false
+--				end
+--			end
+--		end
+--	end
 	return true
1 Like

I activated areas_flak in one area for testing only.
I did think about using i maybe for an event. But fixing this issue has priority.

thanks for the chat3 contribution, it’s a super weird situation but the important thing is the fix. for me it seems to be fixed and the patch is ready for restart on the server

1 Like

thank you for the patch, i’ve allowed myself to change the order a little bit, it is ready for restart on the server :+1:


Could breath be changed to 5 (right side) so it isn’t above the similar colored armor bar? And could the sprint color be changed to something other than the same color as hunger bar?

diff --git a/init.lua b/init.lua
index 02c371a..409a2d7 100644
--- a/init.lua
+++ b/init.lua
@@ -16,7 +16,7 @@ SPRINT_TIMEOUT = 0.5 --Only used if SPRINT_METHOD = 0
 if minetest.get_modpath("hudbars") ~= nil then
 	hb.register_hudbar("sprint", 0xFFFFFF, "Stamina",
-		{ bar = "sprint_stamina_bar.png", icon = "stamina.png" },
+		{ bar = "sprint_stamina_bar.png", icon = "stamina.png^[multiply:#6F6" },
 		false, "%s: %.1f/%.1f")


1 Like