[Mod] TNT [tnt]

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Thu May 30, 2013 14:06

Jordach wrote:"Modding API has been deprecated in favour of a new one."

Does it mean we'll have to convert all our mods to the new api ?
/me hides...
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Thu May 30, 2013 15:30

Zeg9 wrote:
Jordach wrote:"Modding API has been deprecated in favour of a new one."

Does it mean we'll have to convert all our mods to the new api ?
/me hides...
I was using a fake past tense.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
AndDT
Member
 
Posts: 24
Joined: Thu May 02, 2013 06:40
GitHub: AndDT
IRC: AndDT
In-game: AndDT

by AndDT » Wed Jun 19, 2013 11:40

TNT from latest commit explodes immediately after I hit it with torch. Is it bug or feature? Minetest 0.4.7
Proud user of Slackware GNU/Linux
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Jun 19, 2013 12:01

AndDT wrote:TNT from latest commit explodes immediately after I hit it with torch. Is it bug or feature? Minetest 0.4.7

It works for me...
 

arsdragonfly
Member
 
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Wed Jun 19, 2013 13:53

What about adding mese crystal to the recipe?It resembles sulfur,and adding it also prevents abuse of TNT(it's super easy to get coal and gravel)
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Fri Jul 05, 2013 00:16

Is there a way to make it drop Mese and Diamonds? As of now it just destroys/removes them when it explodes.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 05, 2013 00:33

Tedypig wrote:Is there a way to make it drop Mese and Diamonds? As of now it just destroys/removes them when it explodes.

1/3 of all nodes are dropped as items.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Fri Jul 05, 2013 00:44

PilzAdam wrote:
Tedypig wrote:Is there a way to make it drop Mese and Diamonds? As of now it just destroys/removes them when it explodes.

1/3 of all nodes are dropped as items.


Is there a way to make it drop 100% of removed nodes as items?
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Jul 05, 2013 04:38

Tedypig wrote:
PilzAdam wrote:
Tedypig wrote:Is there a way to make it drop Mese and Diamonds? As of now it just destroys/removes them when it explodes.

1/3 of all nodes are dropped as items.


Is there a way to make it drop 100% of removed nodes as items?


Yes, at least this seemed to work for me when I just tried it. In the init.lua file, lines 10, 11 and 12 need to be commented out so it looks like this.

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
        -- if math.random(1,3) == 3 then
        --    return
        -- end


EDIT: Bolded the filename.
Last edited by LionsDen on Fri Jul 05, 2013 04:39, edited 1 time in total.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Fri Jul 05, 2013 06:32

Is there any way to make it more powerful? I was thinking of doing a mod which includes an explosive and I was wondering how to make the explosion of this bigger. I will give credit to PilzAdam and whoever can help.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Jul 05, 2013 07:57

Dan Duncombe wrote:Is there any way to make it more powerful? I was thinking of doing a mod which includes an explosive and I was wondering how to make the explosion of this bigger. I will give credit to PilzAdam and whoever can help.


I have looked and tested and think I have found out the answer. You may not like it though. Lines 63, 64 and 65 control the size of the damage. they are part of the boom function in init.lua. They look like the following:

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
        for dx=-2,2 do
            for dz=-2,2 do
                for dy=2,-2,-1 do


They are the x, y and z sizes of the file. I haven't played with the -1 value in the dy variable so I'm not sure what that does. Currently, the explosion damages nodes 5 nodes wide, 5 nodes deep and 5 nodes high. For my first test, I changed the 2's to 10's and tried it out. Ouch! My system slowed to a super crawl. Snails that are bedridden could move faster. That's because I was blowing up an area 21 wide by 21 deep by 21 nodes high which means the code was deciding what got sent on which trajectory and for how far as well as if any particular node survived the explosion. This was a total of 9,261 nodes that needed to be checked and managed. I had to kill Minetest because I would have been waiting for hours for it to finish. :)

I next tried a smaller number, 4 in place of each 2 and that was far more reasonable. That still gave me an area 9 by 9 by 9 or 729 nodes to check for. This ran much smoother. So if you want really big explosions, you will need to change quite a bit of code and likely at least remove the node drops and velocity calculations or something.


P.S. If you want to remove every node in the area affected, you will need to delete line 79 through 82, look below, but that just leaves a cube.

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
                        else
                            if math.random(1,5) <= 4 then
                                destroy(pos)
                            end


If you want to leave less nodes in the explosion area but still leave some you could change the 5 to a larger number like 10 and the 4 to 1 less than the number chose which in my example would be 9. This would likely leave 1 node for every 10 damaged. If the code is left alone as is, it leaves 1 node out of every 5.


Hope this helps you out.

EDIT: Had to remove one line of code or it would have not been good. :) I accidentally put line 83 in the last code segment I was showing, you don't want to delete that if you do delete it. :)

EDIT #2: Just realized, if you do delete those lines, you wont remove any nodes at all. :D lol You do need them, just modify the numbers to be 5 and 5 or 1 and 1 and it will always remove a node. :)
Last edited by LionsDen on Fri Jul 05, 2013 08:01, edited 1 time in total.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Fri Jul 05, 2013 08:30

LionsDen wrote: I haven't played with the -1 value in the dy variable so I'm not sure what that does

It's the step size for the `for' loop.
If you look, both x and z increase the value each iteration (from -2 to 2), but y does the inverse (from 2 to -2), so the "step" (increment) must be negative (default is 1 if not specified). For more info, I suggest you read the Lua Manual (see §2.4.5).
Last edited by kaeza on Fri Jul 05, 2013 08:37, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 05, 2013 11:26

I see people have fun with my code :-)

I have set the explosion radius to 5 and drop chance to 1/3 to make the TNT not too overpowered.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Fri Jul 05, 2013 15:20

Thankyou! I will probably make it not drop many items. Just so you know, the idea is going to be a part of my mod that only loads if this mod is installed, that adds 'condensed explosives'. i.e. Several TNT compacted into one.
Quick Question: Is there any way of making it not fall when lit? My explosive is intended to be like c4 in MW3- so it sticks to whatever surface you put it on, then blows up.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Jul 05, 2013 18:02

Dan Duncombe wrote:Thankyou! I will probably make it not drop many items. Just so you know, the idea is going to be a part of my mod that only loads if this mod is installed, that adds 'condensed explosives'. i.e. Several TNT compacted into one.
Quick Question: Is there any way of making it not fall when lit? My explosive is intended to be like c4 in MW3- so it sticks to whatever surface you put it on, then blows up.


I have the TNT mod installed and the TNT stays wherever I put it. I have yet to have it fall whether it is lit or unlit.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Fri Jul 05, 2013 19:29

Oh! I didn't know that! Thanks for all this help, everyone!
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Sat Jul 06, 2013 16:04

The TNT makes everything disappear. The blocks should be put in place where it exploded disassembled
Last edited by BrunoMine on Sat Jul 06, 2013 16:04, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

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

by Wuzzy » Tue Sep 24, 2013 21:46

I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
darthvader
Member
 
Posts: 119
Joined: Sun Sep 08, 2013 14:35

by darthvader » Wed Sep 25, 2013 13:54

ModError: Failed to load and run
C:\Users\prosper\Desktop\Minetest\bin\..\mods\TNT\init.lua
Q. Why cant you write with a broken pencil?
A. Because its not in minetest.
(The original answer is "Because it's pointless.")
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Wed Sep 25, 2013 15:29

darthvader wrote:ModError: Failed to load and run
C:\Users\prosper\Desktop\Minetest\bin\..\mods\TNT\init.lua
Rename the mod folder "tnt" not "TNT"
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

Glünggi
Member
 
Posts: 126
Joined: Wed Apr 16, 2014 08:13

Re: [Mod] TNT [tnt]

by Glünggi » Wed Apr 23, 2014 16:58

Hi,
i'm workin on a Minetest - Game and i have your tnt turn in to a Terrabomb.
There dosnt destroy blocks but removed it to default dirt.
Image
Image
simply insert Line
minetest.set_node(pos, {name="default:dirt"})
and delete the dropsection

I hope ist ok for you?
A have a lot of other questions.. because i use other Mods from you like Mobs. But i cant send PM...
There write "conntact a Admin" when u cant send a pm..but how i can conntact when i cant send pm's?
My english is so poor and i cant figure it out
So i try it on this way to conntact you.
Sorry
So pls pm me..an do it on german ;)
 

Daven
Member
 
Posts: 26
Joined: Mon Jan 20, 2014 21:51

Re: [Mod] TNT [tnt]

by Daven » Fri Apr 25, 2014 00:41

Awesome mod
 

gsmanners
Member
 
Posts: 159
Joined: Fri Jan 10, 2014 21:37

Re: [Mod] TNT [tnt]

by gsmanners » Sat Aug 02, 2014 21:29

I noticed the 0.4.10 standard game includes a variation of this mod. I'm wondering where all that radius code came from.
 

KzoneDD
Member
 
Posts: 52
Joined: Wed Sep 17, 2014 09:29

Re: [Mod] TNT [tnt]

by KzoneDD » Sat Mar 05, 2016 22:53

Hi Adam (not calling you Pilz <--- please take note of this), anyone else who knows,

Is there a way to make other nodes respond to burning gunpowder? I'm working on a mod that logically should go boom if in contact with a string of burning gunpowder, see... (well, according to cartoon logic, anyway, which is the best kind of logic).

I mean, I know there are ways, there always are ways... but is there something you specifically recommend I do?

Solutions like checking adjacent nodes ever n ticks seem kinda... lag-inducing...

TIA!

Greetz.
DD.
 

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

Re: [Mod] TNT [tnt]

by Wuzzy » Sun Mar 06, 2016 06:35

KzoneDD, you can use ABMs for that. I don't know how well they perform but that's the way how the tnt mod does it.

Besides, the tnt mod already has a “string” of gunpowder (it does not look like a string but behaves like one), just place gunpowder on the ground and ignite it with torch. I don't know why you want to make another mod for the same feature.
Note that Minetest Game also has a tnt mod. In this one there are actual gunpowder strings.

By the way:
I just looked into the Minetest Game tnt mod and noticed that gunpowder is actually only ignited by lava and fire, hardcoded. It would have been better if groups are used IMO.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

im-poke
Member
 
Posts: 1042
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke

Re: [Mod] TNT [tnt]

by im-poke » Sun Mar 06, 2016 06:43

ACDC-TNT

BOOOOOOM!
Can you make it respond to mesecon, or is it already?
ARE YOU A NYAN CAT?????
--ABJ
 

KzoneDD
Member
 
Posts: 52
Joined: Wed Sep 17, 2014 09:29

Re: [Mod] TNT [tnt]

by KzoneDD » Sun Mar 06, 2016 14:07

I actually want to use the existing mod. :)

An ABM seems like an 'always-on' solution, which in my limited understanding == extra lag.

That's why I was wondering if there was a 'on demand' solution.
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] TNT [tnt]

by ABJ » Fri Jul 15, 2016 19:09

Check this out guys!
Realistic TNT explosion demo
I will continue improving it, I know there is still room, but I feel the devs really should take a look.
Also, don't talk about lag before actually testing my mod. I personally find it less laggy than many default blasts I've experienced.
 

User avatar
Andrey01
Member
 
Posts: 431
Joined: Wed Oct 19, 2016 15:18
In-game: Andrey01

Re: [Mod] TNT [tnt]

by Andrey01 » Tue Nov 29, 2016 13:38

Simple red TNT has default in game
 

Previous

Return to Old Mods

Who is online

Users browsing this forum: No registered users and 7 guests

cron