Jordach wrote:nemo, y=pos.y-0.25 might be a lua thingy. mt may read a positive y as down.
I'm know that it mean, i'm somewhat familiar with the mod writing ))) at that moment i not test posted code. y-0.25 just looks strange..
this will be ok:
Code: Select all
SMOKE = {
physical = true,
collisionbox = {-0.1,-0.1,-0.1,0,0,0},
visual = "sprite",
textures = {"smoke.png"},
on_step = function(self, dtime)
self.object:setacceleration({x=0, y=0.5, z=0})
self.timer = self.timer + dtime
if self.timer > 3 then
self.object:remove()
end
end,
timer = 0,
}
minetest.register_entity("particles:smoke", SMOKE)
minetest.register_abm({
nodenames = {"default:torch"},
interval = 2,
chance = 10,
action = function(pos)
minetest.env:add_entity({x=pos.x,y=pos.y+0.5,z=pos.z}, "particles:smoke")
end,
})
if minetest.get_modpath("jeija") ~= nil then -- Mesecons is installed
MESECONDUST = {
physical = true,
collisionbox = {-0.1,-0.1,-0.1,0,0,0},
visual = "sprite",
textures = {"mesecondust.png"},
on_step = function(self, dtime)
self.timer = self.timer + dtime
if self.timer > 2.5 then
self.object:remove()
end
end,
timer = 0,
}
minetest.register_entity("particles:mesecondust", MESECONDUST)
minetest.register_abm({
nodenames = {"jeija:mesecon_on","jeija:wall_lever_on","jeija:mesecon_torch_on"},
interval = 1,
chance = 5,
action = function(pos)
minetest.env:add_entity({x=pos.x,y=pos.y,z=pos.z}, "particles:mesecondust")
end,
})
end