prof-turbo wrote:I love this mod! why do you don't add sounds now? :D
Made in an ancient version with your mod and the creative ;):
csf2618 wrote:got an available source code?
sfan5 wrote:
- You can now use mesecons to activate TNT
if minetest.get_modpath("tnt") then
minetest.register_abm({
nodenames = { "nuke:mese_tnt", "nuke:iron_tnt" },
neighbors = { "tnt:gunpowder_burning" },
interval = 1,
chance = 1,
action = function(pos, node)
minetest.remove_node(pos)
spawn_tnt(pos, node.name)
nodeupdate(pos)
end
})
end
Napiophelios wrote:I am glad this mod still works with newer Minetest, its one of my favorites :)sfan5 wrote:
- You can now use mesecons to activate TNT
I always wonder why gunpowder couldnt be used by players to activate like TNT mod.
I made a little ABM to work like that, its amateur but it seems to work okay.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 minetest.get_modpath("tnt") then
minetest.register_abm({
nodenames = { "nuke:mese_tnt", "nuke:iron_tnt" },
neighbors = { "tnt:gunpowder_burning" },
interval = 1,
chance = 1,
action = function(pos, node)
minetest.remove_node(pos)
spawn_tnt(pos, node.name)
nodeupdate(pos)
end
})
end
sfan5 wrote:Today I've decided to update this mod because it was showing it's age (last update was two years ago).
The new version is 2.0 and can the downloaded in the original post; Changelog:
- Complete code rewrite, now licensed under MIT
- Hardcore TNT renamed to Extreme TNT
- Minor texture changes
- Crafting now accepts any kind of wood
sfan5 wrote: now licensed under MIT
Hybrid Dog wrote:sfan5 wrote: now licensed under MIT
Do l need to update the license information at my fork?
https://github.com/hybriddog/nuke
local function on_explode_normal(pos, range)
minetest.sound_play("nuke_explode", {pos = pos, gain = 1.0, max_hear_distance = 32})
local nd = minetest.registered_nodes[minetest.get_node(pos).name]
if nd ~= nil and nd.groups.water ~= nil then
return -- cancel explosion
end
local min = {x=pos.x-range,y=pos.y-range,z=pos.z-range}
local max = {x=pos.x+range,y=pos.y+range,z=pos.z+range}
local vm = minetest.get_voxel_manip()
local emin, emax = vm:read_from_map(min,max)
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local data = vm:get_data()
local air = minetest.get_content_id("air")
for z=-range, range do
for y=-range, range do
for x=-range, range do
if x*x+y*y+z*z <= range*range + range then
local nodepos = vector.add(pos, {x=x, y=y, z=z})
local p_pos = area:index(pos.x+x,pos.y+y,pos.z+z)
local n = minetest.get_name_from_content_id(data[p_pos])
if n ~= "air" then
activate_if_tnt(n, nodepos, pos, range)
data[p_pos] = air
end
end
end
end
end
--vm:calculate_lighting()
vm:set_data(data)
vm:write_to_map()
vm:update_map()
apply_tnt_physics(pos, range)
end
Diamond knight wrote:I think this mod should be updated to use new TNT API.
Users browsing this forum: No registered users and 8 guests