Posted: Mon Jan 02, 2012 16:08
I did. I guess i need new version huh ?
The official Minetest discussion board
https://forum.minetest.net/
YesStaffs wrote:I did. I guess i need new version huh ?
i can't tell you right now..because i am going to release a HUGE mod maybe in a week or so..but trust me you will know soonJeija wrote:Nope! Just take it if you want. The code is under the do-what-the-f***-you-want license.
But please tell me what you needed the code for... I'm just so curious ^^.
It's a bug, not a feature. We must be patient and pray^W wait for it to be fixed.Staffs wrote:I think you should change "Object detector" crafting. Cause its SO hard to find iron
Code: Select all
--INVERTER: add this to your init.lua file, near the bottom somewhere
minetest.register_node("jeija:mesecon_inverter_off", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_inverter.png"},
inventory_image = "jeija_mesecon_inverter.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
})
minetest.register_node("jeija:mesecon_inverter_on", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_inverter.png"},
inventory_image = "jeija_mesecon_inverter.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
dug_item='node "jeija:mesecon_inverter_off" 1',
})
--mesecon:register_on_signal_on(function(pos, node)
minetest.register_on_punchnode(function(pos, node)
if node.name=="jeija:mesecon_inverter_on" then
minetest.env:add_node(pos, {name="jeija:mesecon_inverter_off"})
nodeupdate(pos)
mesecon:receptor_off(pos)
end
end)
mesecon:register_on_signal_off(function(pos, node)
if node.name=="jeija:mesecon_inverter_off" then
minetest.env:add_node(pos, {name="jeija:mesecon_inverter_on"})
nodeupdate(pos)
mesecon:receptor_on(pos)
end
end)
minetest.register_on_dignode(
function(pos, oldnode, digger)
if oldnode.name == "jeija:mesecon_inverter_on" then
mesecon:receptor_off(pos)
end
end
)
mesecon:add_receptor_node("jeija:mesecon_inverter_on")
mesecon:add_receptor_node_off("jeija:mesecon_inverter_off")
minetest.register_craft({
output = 'node "jeija:mesecon_inverter_off" 2',
recipe = {
{'node "jeija:mesecon_off"'},
{'node "default:junglegrass"'},
{'node "jeija:mesecon_off"'},
}
})
My pleasure. You've done a great job with this and I'd really like to see this go far.Jeija wrote:@Temperest: First of all, huge thanks for (trying to) contribute/ing to the mod!!!
Well that's kind of the problem I was trying to solve - how to avoid delays in the logic. I don't think the one second delay would allow for more complicated stuff like adders and etc.Jeija wrote:1) Make a delay using an ABM or - much better the on_globalstep event. (Just create a timer and put timer=timer+dtime in the globalstep func). Create a like 1 second delay so that the server can't crash. Handle the turnoff/turnon after the 1 second has passed.
I'll give this method a try. Actually, I had an idea - a diode made out of two blocks, the input and the output, and the output block would have two variations: normal and inverted. This seems to not need a delay, I'll write back soon with my results.Jeija wrote:2) Make the inverter directional. The output is always on the other side of the input. Unfortunately, you would have to get the orientation of the node for this (im not sure if this is possible at all) or save your own orientation in param2 i guess of the inverter node.
Isn't this what wireless receivers/inverters/transmitters actually do? Or what do you mean by that? Sorry if I just misunderstood you. Keep on!Actually, I had an idea - a diode made out of two blocks, the input and the output, and the output block would have two variations: normal and inverted.
Yeah it is pretty similar, actually, but without channels, and range limited to one block.Jeija wrote:Isn't this what wireless receivers/inverters/transmitters actually do? Or what do you mean by that? Sorry if I just misunderstood you. Keep on!Actually, I had an idea - a diode made out of two blocks, the input and the output, and the output block would have two variations: normal and inverted.
Same reason as me, I guessJeija wrote:Why would you need a block to be receptor and effector at the same time? In some cases it is also possible without a delay.