[Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]
- IPushButton2653
- Member
- Posts: 666
- Joined: Wed Nov 16, 2011 22:47
- Location: Mississippi
- Contact:
There are lots of possibilities in this mod... There are like 5 ways to do the same thing ^^ There are 3 different inverters eg. ;
I'm not sure if that is good or if an easy method with only a few parts (like in minecraft) was better...
I will try to implement Basto's code as soon as possible, I can also give you the permission to implement it on github if you want (Or anyone else can also implement it). Please just ask me for the permission on github here!!
@Sfan5: Would be awesome if you made a global timer for the buttons. Just set a requested state for each button and a time when the state will be changed. Try to save it in param1/2 or so. I would also need the global timer for your mesecon torches
I'm not sure if that is good or if an easy method with only a few parts (like in minecraft) was better...
I will try to implement Basto's code as soon as possible, I can also give you the permission to implement it on github if you want (Or anyone else can also implement it). Please just ask me for the permission on github here!!
@Sfan5: Would be awesome if you made a global timer for the buttons. Just set a requested state for each button and a time when the state will be changed. Try to save it in param1/2 or so. I would also need the global timer for your mesecon torches
Last edited by Jeija on Sun Jan 08, 2012 08:52, edited 1 time in total.
- IPushButton2653
- Member
- Posts: 666
- Joined: Wed Nov 16, 2011 22:47
- Location: Mississippi
- Contact:
I will upload a video of a giant self-building bridge soon. It has 3 floors: One for cars, one for trains and one for pedestrians. Just have to wait for my classmate to render the vid. It is possible using this mod and the nyanland mod.
Last edited by Jeija on Sun Jan 08, 2012 08:55, edited 1 time in total.
- IPushButton2653
- Member
- Posts: 666
- Joined: Wed Nov 16, 2011 22:47
- Location: Mississippi
- Contact:
- IPushButton2653
- Member
- Posts: 666
- Joined: Wed Nov 16, 2011 22:47
- Location: Mississippi
- Contact:
-
- Moderator
- Posts: 4095
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
Just fixed the Rotating-Switch-Bug!
It was param1 not param2.
It was param1 not param2.
NIce sfan5, thx for fixing. I once tried param1 myself, but it didn't work back then Maybe I made a small mistake or so. NIce to know that btw.
I guess, sfan5, you should make different mesecon rules for buttons. Just put them in the get_rules function (I will maybe add a add_rules function when I have more time). Just look at the mesecon torch code for this.
I guess, sfan5, you should make different mesecon rules for buttons. Just put them in the get_rules function (I will maybe add a add_rules function when I have more time). Just look at the mesecon torch code for this.
-
- Moderator
- Posts: 4095
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
Ok, I'll make a different Mesecon-Rule for buttons.Jeija wrote:NIce sfan5, thx for fixing. I once tried param1 myself, but it didn't work back then Maybe I made a small mistake or so. NIce to know that btw.
I guess, sfan5, you should make different mesecon rules for buttons. Just put them in the get_rules function (I will maybe add a add_rules function when I have more time). Just look at the mesecon torch code for this.
Done: https://github.com/Jeija/minetest-mod-m ... 4163ebc2ee
Last edited by sfan5 on Sun Jan 08, 2012 11:49, edited 1 time in total.
Some changes on github, check them out.
e.g. object detectors above signs indicate the player name on the sign and new mesecon button rules. Also splitted files (I'll continue doing that, so commiting will be easier)
@Sfan5: How do I delete the README~ file? I have no idea...
@hijera: These blocks would be possible, but I can't do them myself (simply don't have time). If you or someone else wants to do that, just commit it.
e.g. object detectors above signs indicate the player name on the sign and new mesecon button rules. Also splitted files (I'll continue doing that, so commiting will be easier)
@Sfan5: How do I delete the README~ file? I have no idea...
@hijera: These blocks would be possible, but I can't do them myself (simply don't have time). If you or someone else wants to do that, just commit it.
Last edited by Jeija on Sun Jan 08, 2012 18:49, edited 1 time in total.
-
- Moderator
- Posts: 4095
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
"git rm README~" should workJeija wrote:Some changes on github, check them out.
e.g. object detectors above signs indicate the player name on the sign and new mesecon button rules. Also splitted files (I'll continue doing that, so commiting will be easier)
@Sfan5: How do I delete the README~ file? I have no idea...
@hijera: These blocks would be possible, but I can't do them myself (simply don't have time). If you or someone else wants to do that, just commit it.
Jeija: Am I allowed to use your code for a mod/fix?
I'll try to rebuild corefunctions from scratch.
My targets for this project:
Every 'input'-node knows all 'output'-nodes, which state is dependant on that node. (maximum of 6)
Every node know the flow-directions of each side: comes/goes/none.
the calculation of the flowdirection could take a while, have to use accumulators to avoid oscillators.
(only finds the next 'input' the rest of the circuit is not important)
The flow of electricity needs only the 'i/o'-nodes ... the rest is just 'decoration'.
In big circuits it'll never happen that the whole circuit must be recalculated!
And I would call the inverters esem-blocks (mese reversed)
… and don't wait for that, could take a while.
I'll try to rebuild corefunctions from scratch.
My targets for this project:
- flipflops and oscillator should be impossible (instead special nodes for that: blinky plant and a d-flipflop consisting of 3 blocks)
- electricity flows from input to output
- circuit without abm
Every 'input'-node knows all 'output'-nodes, which state is dependant on that node. (maximum of 6)
Every node know the flow-directions of each side: comes/goes/none.
the calculation of the flowdirection could take a while, have to use accumulators to avoid oscillators.
(only finds the next 'input' the rest of the circuit is not important)
The flow of electricity needs only the 'i/o'-nodes ... the rest is just 'decoration'.
In big circuits it'll never happen that the whole circuit must be recalculated!
And I would call the inverters esem-blocks (mese reversed)
… and don't wait for that, could take a while.
Is there anything that can be done about the 30 block limitation? I ran into this too when I put a flashing light on top of a tall tower.Jeija wrote:For the adder: Make sure that the whole machine is in a close radius, like 30 blocks away. Unfortunately, if mesecon circuits are farer away, minetest doesn't simulate them.
@Temperest: Looks awesome! I can add you to git if you give me your name... Else, just post it here.
Oh, my username at GitHub is Uberi.
And, as promised, the updated code:
Code: Select all
--TEMPEREST-PLUG
minetest.register_node("jeija:mesecon_plug", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_plug.png"},
inventory_image = "jeija_mesecon_plug.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
})
mesecon:register_on_signal_on(function(pos, node)
if node.name=="jeija:mesecon_plug" then
local set_node_on = function(pos)
node = minetest.env:get_node(pos)
if node.name=="jeija:mesecon_socket_off" then
minetest.env:add_node(pos, {name="jeija:mesecon_socket_on"})
nodeupdate(pos)
mesecon:receptor_on(pos)
elseif 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
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z+2}) end
end
end)
mesecon:register_on_signal_off(function(pos, node)
if node.name=="jeija:mesecon_plug" then
local set_node_off = function(pos)
node = minetest.env:get_node(pos)
if node.name=="jeija:mesecon_socket_on" then
minetest.env:add_node(pos, {name="jeija:mesecon_socket_off"})
nodeupdate(pos)
mesecon:receptor_off(pos)
elseif 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
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x-2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x+2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x-2, y=pos.y, z=pos.z+2}) end
end
end)
minetest.register_on_dignode(function(pos, oldnode, digger)
if oldnode.name == "jeija:mesecon_plug" then
local set_node_deactivated = function(pos)
node = minetest.env:get_node(pos)
if node.name=="jeija:mesecon_socket_on" then
minetest.env:add_node(pos, {name="jeija:mesecon_socket_off"})
nodeupdate(pos)
mesecon:receptor_off(pos)
elseif 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
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_deactivated({x=pos.x-2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_deactivated({x=pos.x+2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_deactivated({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_deactivated({x=pos.x-2, y=pos.y, z=pos.z+2}) end
end
end)
minetest.register_craft({
output = 'node "jeija:mesecon_plug" 2',
recipe = {
{'', 'node "jeija:mesecon_off"', ''},
{'node "jeija:mesecon_off"', 'craft "default:steel_ingot"', 'node "jeija:mesecon_off"'},
{'', 'node "jeija:mesecon_off"', ''},
}
})
--TEMPEREST-SOCKET
minetest.register_node("jeija:mesecon_socket_off", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_socket_off.png"},
inventory_image = "jeija_mesecon_socket_off.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
})
minetest.register_node("jeija:mesecon_socket_on", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_socket_on.png"},
inventory_image = "jeija_mesecon_socket_on.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
dug_item='node "jeija:mesecon_socket_off" 1',
})
minetest.register_on_dignode(
function(pos, oldnode, digger)
if oldnode.name == "jeija:mesecon_socket_on" then
mesecon:receptor_off(pos)
end
end
)
mesecon:add_receptor_node("jeija:mesecon_socket_on")
mesecon:add_receptor_node_off("jeija:mesecon_socket_off")
minetest.register_craft({
output = 'node "jeija:mesecon_socket_off" 2',
recipe = {
{'', 'craft "default:steel_ingot"', ''},
{'craft "default:steel_ingot"', 'node "jeija:mesecon_off"', 'craft "default:steel_ingot"'},
{'', 'craft "default:steel_ingot"', ''},
}
})
--TEMPEREST-INVERTER
minetest.register_node("jeija:mesecon_inverter_off", {
drawtype = "raillike",
paramtype = "light",
is_ground_content = true,
tile_images = {"jeija_mesecon_inverter_off.png"},
inventory_image = "jeija_mesecon_inverter_off.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_on.png"},
inventory_image = "jeija_mesecon_inverter_on.png",
material = minetest.digprop_constanttime(0.1),
walkable = false,
selection_box = {
type = "fixed",
},
dug_item='node "jeija:mesecon_inverter_off" 1',
})
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"', 'craft "default:steel_ingot"', 'node "jeija:mesecon_off"'},
{'craft "default:steel_ingot"', '', 'craft "default:steel_ingot"'},
{'node "jeija:mesecon_off"', 'craft "default:steel_ingot"', 'node "jeija:mesecon_off"'},
}
})
Will look into it.
WorldEdit 1.0 released
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
@Sfan5: I guess that happened because i had to --force the upload (I forgot to pull and didn't want to push). Well, I'm just new to git...
@Basto: yep, just use it
@Temperest: I added you on git, please commit your code.
If any code can make the server crash, please disable it using a setting variable please!
(Like it already is with Temperest's awesome commit. It says TEMPEREST_ENABLE=0 in init.lua)
Please also use Tabs for syntax and not spaces if possible.
@Basto: yep, just use it
@Temperest: I added you on git, please commit your code.
If any code can make the server crash, please disable it using a setting variable please!
(Like it already is with Temperest's awesome commit. It says TEMPEREST_ENABLE=0 in init.lua)
Please also use Tabs for syntax and not spaces if possible.
Any c++ dev know this?Is there anything that can be done about the 30 block limitation? I ran into this too when I put a flashing light on top of a tall tower.
Who is online
Users browsing this forum: No registered users and 33 guests