Page 1 of 1

Multiplayer-safe TNT

PostPosted: Wed Oct 19, 2016 10:05
by gpcf
I have modified the TNT mod included with the default game to be safe for multiplayer games (To be fair, I've added about 3 lines). In my mod, TNT does not explode under any circumstances when placed above -100, so it can be used in deep mines without having to worry about griefing. It is deliberately named the same as the default mod, since this mod replaces it. It is used exactly the same way as the default mod.

Edit: When you light the gunpowder, there is an air-raid alarm to warn other players.

Browse the code, Download a .zip.

Re: Multiplayer-safe TNT

PostPosted: Wed Oct 19, 2016 15:34
by azekill_DIABLO
nice! you should also add a check to make the tnt only active if there is no tnt next to it!

Re: Multiplayer-safe TNT

PostPosted: Wed Oct 19, 2016 19:55
by gpcf
No, that's okay, since the TNT only explodes below -100. There is no way to make it explode above that height. I like to have big explosions in mines.

Re: Multiplayer-safe TNT

PostPosted: Thu Oct 20, 2016 09:16
by azekill_DIABLO
ok! that your mod! +1

Re: Multiplayer-safe TNT

PostPosted: Thu Oct 20, 2016 17:55
by taikedz
Nice :-)

Might be interesting to use a configurable depth?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local tntmindepth = minetest.get_setting("tnt.mindpeth") or -100


I love the air-raid touch too ;-)

Re: Multiplayer-safe TNT

PostPosted: Sat Oct 22, 2016 11:25
by gpcf
Done!

Re: Multiplayer-safe TNT

PostPosted: Sat Oct 22, 2016 15:07
by amadin
I thought about a similar mod when I had a server.
Edit: When you light the gunpowder, there is an air-raid alarm to warn other players.

I think it's not necessary, is not too realistic, or add an option in config file.

Re: Multiplayer-safe TNT

PostPosted: Fri Nov 04, 2016 03:37
by AnxiousInfusion
Game crashes when TNT explodes at -600 Y in single player.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-11-03 23:33:50: ACTION[Server]: LuaEntitySAO at (-1.15,-593.5,-23.1137) punched by LuaEntitySAO at (-1.15,-593.5,-23.1137), damage 12 hp, health now 0 hp
2016-11-03 23:33:50: ACTION[Server]: LuaEntitySAO at (-1.22515,-593.5,-27.85) punched by LuaEntitySAO at (-1.22515,-593.5,-27.85), damage 4 hp, health now 1 hp
minetest: /build/minetest-_IuHPE/minetest-0.4.14/src/util/serialize.h:278: void writeF1000(irr::u8*, irr::f32): Assertion `i >= ((float)(s32)((-0x7FFFFFFF - 1) / 1000.0f)) && i <= ((float)(s32)((0x7FFFFFFF) / 1000.0f))' failed.
Aborted


You are supposed to replace the default tnt mod for this to work?