Tnt changes?

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

Tnt changes?

by mcfan » Sat Mar 29, 2014 13:58

I'm trying to make tnt not destroy anything that has water between it and the tnt, and...
I'm trying to make obsidian take 10 tnt hits before breaking.

Are these possible? Am I posting to many questions and ideas? lol
Love MINECRAFT... will settle for Minetest
 

User avatar
pop_harte
Member
 
Posts: 27
Joined: Sun Mar 23, 2014 07:39

by pop_harte » Sat Mar 29, 2014 17:12

OK
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Sat Mar 29, 2014 17:13

Ok what?
Love MINECRAFT... will settle for Minetest
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sat Mar 29, 2014 17:51

can you provide a link to the mod(Tnt has been made by many modders)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Sat Mar 29, 2014 19:02

Love MINECRAFT... will settle for Minetest
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sat Mar 29, 2014 19:46

replace the init.lua file with this(the init.lua is in the mods file) this replaces the water for a node called nomod:nonode witch AFAIK doesn't exist
Attachments

[The extension lua has been deactivated and can no longer be displayed.]

Last edited by DeepGaze on Sat Mar 29, 2014 19:54, edited 1 time in total.
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Sat Mar 29, 2014 20:24

So is it replacing the default:water? What is it doing exactly?
Love MINECRAFT... will settle for Minetest
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sat Mar 29, 2014 21:29

it is stopping the function by telling it to look for a false node(the code is pretty foreign to me)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Sat Mar 29, 2014 21:37

Sorry to tell you this, but it didn't change anything. Destroyed stuff while in water and destroyed obsidian in one blast.
Love MINECRAFT... will settle for Minetest
 

noobly
Member
 
Posts: 29
Joined: Fri Apr 19, 2013 15:47

by noobly » Sat Mar 29, 2014 22:41

1. ask the mod creators
2. next time post these sort of things under mod requests
3. no hard feelings :)
4. HAVE FUN!
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Sat Mar 29, 2014 22:44

Why ask the mod creators? Why can't someone else take a stab at it if I can't get ahold of them?
Last edited by mcfan on Sat Mar 29, 2014 22:44, edited 1 time in total.
Love MINECRAFT... will settle for Minetest
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sun Mar 30, 2014 15:48

post on the forum topic for best results: I was doing what I could without knowing the code (worst idea ever conceived, forgive me)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
minermoder27
Member
 
Posts: 127
Joined: Wed Nov 20, 2013 23:24
GitHub: ZNixian
In-game: minermoder27

by minermoder27 » Mon Mar 31, 2014 00:42

PilzAdam's TNT mod simply removes all non-liquid nodes inside a area: it does not check what is between that node and the TNT. Consider copying parts of my TNT mod, as it checks all the nodes in between
Last edited by minermoder27 on Mon Mar 31, 2014 00:43, edited 1 time in total.
My best mods:
Buildtest
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Tue Apr 01, 2014 11:42

your mod would make a BIG mess of my place though because of all the tnt and their power. Does your tnt stop if there is water between it and a node?
Love MINECRAFT... will settle for Minetest
 

User avatar
mcfan
Member
 
Posts: 120
Joined: Wed Mar 26, 2014 15:02

by mcfan » Thu Apr 03, 2014 19:56

So was this a impossible idea?
Love MINECRAFT... will settle for Minetest
 

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

by LionsDen » Fri Apr 04, 2014 01:10

I would say it's possible but difficult to implement. Not super difficult but a little bit.
 

User avatar
minermoder27
Member
 
Posts: 127
Joined: Wed Nov 20, 2013 23:24
GitHub: ZNixian
In-game: minermoder27

by minermoder27 » Wed Apr 09, 2014 01:04

I was not suggesting you copy all of it, just the ray casting bits.

[spoiler]
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 ents = {}
        local storedPoses = {}
       
        for dx=-tnt_range,tnt_range do
            for dz=-tnt_range,tnt_range do
                for dy=-tnt_range,tnt_range do
                    --local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
                    ----------------------------------------
                    local dist = (dx^2) + (dy^2) + (dz^2)
                    dist = dist^(1/2.0)
                    if dist < tnt_range and dist + 1 >= tnt_range and dist~=0 then
                        local dir = {x=dx, y=dy, z=dz}
                        --local totalnum = math.abs(dir.x)+math.abs(dir.y)+math.abs(dir.z)
                        --dir = vector.normalize(dir)--vector.divide(dir, vector.new(totalnum, totalnum, totalnum))
                        dir.x = dir.x / dist
                        dir.y = dir.y / dist
                        dir.z = dir.z / dist
                        --local p = {x=pos.x, y=pos.y, z=pos.z} -- {x=0,y=0,z=0}--
                        local blast = tnt_range / 3
                        for i=1, dist do
--                            i = i - 0.5
                            local pp = {x=dir.x*i, y=dir.y*i, z=dir.z*i}
                            local p  = vector.add(pp, pos)
                            p.x = math.floor(p.x)
                            p.y = math.floor(p.y)
                            p.z = math.floor(p.z)
                            for i=1, #storedPoses do
                                if p.x==storedPoses[i].x and p.y==storedPoses[i].y and p.z==storedPoses[i].z then
                                    --print("p: "..dump(p) .. " storedPoses: "..dump(storedPoses[i]))
                                    p = nil
                                    break
                                end
                            end
                           
                            if p==nil then break end
                            --local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
                            --vector.add(p, dir)
                            ----------------------------------------
--                            local p_node = area:index(p.x, p.y, p.z)
--                            local d_p_node = nodes[p_node]
                            local node = minetest.get_node(p)
                            -------------------------------------------------------------
                            blast = blast - (tnt.force[node.name] or 3)
                            if tnt.accl[node.name]==true then
                                storedPoses[#storedPoses + 1] = {x=p.x, y=p.y, z=p.z}
                                local stored = minetest.get_meta(p):get_int("blast") or 0
                                blast = blast + stored
                            end
                            if blast <= 0 then
                                if tnt.accl[node.name]==true then
                                    minetest.get_meta(p):set_int("blast", tnt.force[node.name] + blast)
                                end
                                break
                            end
                            -------------------------------------------------------------
        --                    if d_p_node == tnt_c_tnt
        --                            or d_p_node == tnt_c_tnt_burning then
                            if is_tnt(node.name)==true then
                                --nodes[p_node] = tnt_c_tnt
                                minetest.remove_node(p)
                                boom_id(p, 0.5, player, node.name) -- was {x=p.x, y=p.y, z=p.z}
                            elseif not ( d_p_node == tnt_c_fire
                                    or string.find(node.name, "default:water_")
                                    or string.find(node.name, "default:lava_")) then
                                --if math.abs(dx)<tnt_range and math.abs(dy)<tnt_range and math.abs(dz)<tnt_range then
                                destroy(p, player, ents)
                                --elseif pr:next(1,5) <= 4 then
                                --    destroy(p, player, ents)
                                --end
                            end
                        end
                    --------------------------------------------
                    end
                    --------------------------------------------
                end
            end
           
        end
       
        for name, val in pairs(ents) do
            drop_item(pos, name, player, val)
        end
[/spoiler]

you would need to change it to fit, and make it stop when it hits water
[spoiler]Hint: somewhere around
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 is_tnt(node.name)==true then
                                --nodes[p_node] = tnt_c_tnt
                                minetest.remove_node(p)
                                boom_id(p, 0.5, player, node.name) -- was {x=p.x, y=p.y, z=p.z}
                            elseif not ( d_p_node == tnt_c_fire
                                    or string.find(node.name, "default:water_")
                                    or string.find(node.name, "default:lava_")) then
                                --if math.abs(dx)<tnt_range and math.abs(dy)<tnt_range and math.abs(dz)<tnt_range then
                                destroy(p, player, ents)
                                --elseif pr:next(1,5) <= 4 then
                                --    destroy(p, player, ents)
                                --end
                            end
[/spoiler]
My best mods:
Buildtest
 


Return to WIP Mods

Who is online

Users browsing this forum: Bing [Bot] and 10 guests

cron