[Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 08:54

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.
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Sun Jan 08, 2012 09:00

I'm making a room that the floor dissappears when you walk on it
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 09:06

That should not be too difficult. Just use an object detector and a Mesecon network under the removestone floor.
Btw, I love this idea, Basto:
object detectors on top of sings should only activate if player, which name is on the sign, is near to the detector
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Sun Jan 08, 2012 09:16

If I can make it work, it will be awesome
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 08, 2012 09:36

Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 09:38

Amazing!! Good job!
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 08, 2012 09:46

Just fixed the Rotating-Switch-Bug! :)
It was param1 not param2.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Sun Jan 08, 2012 09:49


@Jordach: That sounds really interesting. If you like I would be willing to help with that. I've always wanted to try my hand at something more than an adder :).


yup I'm learning from mc vids.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 10:02

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.
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 08, 2012 11:19

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.

Ok, I'll make a different Mesecon-Rule for buttons.
Done: https://github.com/Jeija/minetest-mod-mesecons/commit/0e3d6e95f5c29b88d6b6f1ea889c974163ebc2ee
Last edited by sfan5 on Sun Jan 08, 2012 11:49, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

hijera
Member
 
Posts: 36
Joined: Sun Jun 19, 2011 13:04

by hijera » Sun Jan 08, 2012 15:50

what's about and/or/not/xor blocks? It's possible to make logical structures using invertor, but it become so bulky then
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 18:48

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.
Last edited by Jeija on Sun Jan 08, 2012 18:49, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 08, 2012 19:32

Jeija 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.

"git rm README~" should work
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 08, 2012 19:39

didnt work. gonna retry tomorow and post the error if still not working
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 08, 2012 20:55

My Commits disappeared. I can't see them under Commits! :O
Last edited by sfan5 on Sun Jan 08, 2012 20:57, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

Baŝto
New member
 
Posts: 9
Joined: Fri Jan 06, 2012 13:46

by Baŝto » Sun Jan 08, 2012 22:44

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:
  • 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

I'll use inputs/outputs and 'virtual' input/outputs (forks, inverters ...)
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.
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Sun Jan 08, 2012 23:21

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.


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.

Oh, my username at GitHub is Uberi.

And, as promised, the updated code:

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
--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"'},
    }
})


Still could not get timers to work :/. This version does without it. Remember not to connect plugs to inverters directly, or MineTest may crash.

Will look into it.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Mon Jan 09, 2012 12:07

@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.

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.

Any c++ dev know this?
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Jan 09, 2012 13:02

Jeija wrote:@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...

That not the Sense of Git
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Mon Jan 09, 2012 13:37

I know and I found out later, but as I said I just don't know much about it. In fact, your code is in the patch, I just cloned to another directory. I hope this won't happen again.
I added you, Basto.
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Jan 09, 2012 13:43

Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Jan 09, 2012 15:00

I'm working on an API to add Lightstone.
Current State:
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
mesecon:lightstone_add(name, base_item, texture_off, texture_on)

This Function creates the Block, the Crafting Recipe and the Functionatility of the Block
Example:
mesecon:lightstone_add("red", "craft default:clay_brick 1", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png")
Crafting Recipe will be:
Image
The Orange Fields represent BaseItem, in the Example Cooked Clay

Other Screenshots:
Image
Image
Last edited by sfan5 on Mon Jan 09, 2012 15:03, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Mon Jan 09, 2012 15:38

Nice!
+1
Last edited by Jeija on Mon Jan 09, 2012 15:38, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Jan 09, 2012 15:47

Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Jan 09, 2012 16:59

Added Green(Cactus),Gray(Cobble) and Darkgray(Gravel) Lightstones:
https://github.com/Jeija/minetest-mod-mesecons/commit/fd08158f22f75ea77a61c21370b367fc09c7c354
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

davos
New member
 
Posts: 1
Joined: Wed Jan 11, 2012 22:20

by davos » Wed Jan 11, 2012 22:23

Help Pls! :)

I really like to use this mod but i can't install it... :( I tried to copy it to the specified folder but i cant see any changes in the game. I tried with Linux version (installed) and windows version as well. What could be the problem? I using the latest version of minetest..
Thx
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Thu Jan 12, 2012 06:05

First of all you will have to download the latest 0.4 snapshot, or use the git if you know how to:
https://github.com/downloads/celeron55/minetest/minetest-0.4.dev-20120106-1-win32.zip
The git version provides no binaries for both Windows and Linux, you will have to compile it yourself (check the downloads page)

Then you will have to install the mods:
On Linux, if you are compiling without run_in_place parameter: /home/"username"/.minetest/ - then create a folder named "usermods" there, then drop the "jeija" folder inside.
On Linux, if you are compiling with run_in_place parameter: /home/"username"/"minetest's-installation-folder"/ - then create a folder named "usermods" there, then drop the "jeija" folder inside.

Note: you cannot play on 0.3 servers with a 0.4 client.
 

User avatar
sycam
Member
 
Posts: 24
Joined: Thu Jan 05, 2012 10:57

by sycam » Thu Jan 12, 2012 23:41

i like mods to be in zip because my minetest dosen't like tar
sycam industry's yesterdays technology today
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Thu Jan 12, 2012 23:50

i don't think minetest likes zip either ... but I could be wrong I didn't test this. I think you'll have to extract both.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
sycam
Member
 
Posts: 24
Joined: Thu Jan 05, 2012 10:57

by sycam » Sat Jan 14, 2012 12:50

sycam wrote:i like mods to be in zip because my minetest dosen't like tar


sorry i recently found out that tar is a Linux file ind i'm using windows 7
sycam industry's yesterdays technology today
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 10 guests

cron