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

User avatar
Staffs
Member
Posts: 329
Joined: Thu Aug 04, 2011 13:16

by Staffs » Post

I did. I guess i need new version huh ?
I love mods :D

sfan5
Moderator
Posts: 4093
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Staffs wrote:I did. I guess i need new version huh ?
Yes
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

:D I have created a basic one time delay system. I'll post how-to later. I'll be working on creating a delay system that isn't one time for now.

(note: this time delay is not another mod, or a change to the mesecons, it is just a delay system using material already in the mod)
Last edited by Gatharoth on Tue Jan 03, 2012 00:15, edited 1 time in total.

Ushiua
New member
Posts: 4
Joined: Mon Jan 02, 2012 16:09

by Ushiua » Post

You are my god.

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

Okay found a bug, sticky movestones return to regular movestones after the first use. Well, its not a bug if that was intentional.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

Its a bug, I may fix that. But it will take some time... I don't have that much time for mod development at the moment.
Redstone for minetest: Mesecons (mesecons.net)

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

Ah, okays. Well, that's okay. I mean come on, mod development for a game that hasn't even hit alpha/beta stage yet isn't too important.

(I said alpha stage, because to "most" gaming companies, this does not have all it's intended features and systems, where as an alpha stage game will have them, but of course, they will be buggy.)

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

jeija do you mind if i use a heavily modified section of your code in one of my mods?
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

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

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Jeija 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 ^^.
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 soon :D
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

:D!!!
Redstone for minetest: Mesecons (mesecons.net)

User avatar
Staffs
Member
Posts: 329
Joined: Thu Aug 04, 2011 13:16

by Staffs » Post

I think you should change "Object detector" crafting. Cause its SO hard to find iron :/
I love mods :D

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

Staffs wrote:I think you should change "Object detector" crafting. Cause its SO hard to find iron :/
It's a bug, not a feature. We must be patient and pray^W wait for it to be fixed.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

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

by Temperest » Post

I tried to make an inverter since wireless inverters were a bit cumbersome:

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"'},
    }
})
It's not working, though - MineTest crashes due to the two signal handlers causing conflicting messages to be sent. You can see what I mean if you put in print() statement in the function bodies: "signal on signal off signal on..."

My question is, how would I write it to create a "proper" inverter? Is it possible with the current architecture? I'm new to lua and any help would be appreciated.
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
Location: Nürtingen, Germany

by Jeija » Post

@Temperest: First of all, huge thanks for (trying to) contribute/ing to the mod!!!
I tried the same thing, and of course this bug also happened to me...
There are two ways to handle this problem:
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 use this method for the wireless inverters
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.

I hope you could understand me and I could help you. If not, feel free to ask again!
Cheers, Jeija
Last edited by Jeija on Tue Jan 03, 2012 17:20, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)

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

by Temperest » Post

Jeija wrote:@Temperest: First of all, huge thanks for (trying to) contribute/ing to the mod!!!
My pleasure. You've done a great job with this and I'd really like to see this go far.
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.
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: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.
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.

Once again, keep up the great work!
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
Location: Nürtingen, Germany

by Jeija » Post

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

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

jeija! go to redcrabs server! the one with port 30001!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

wait... I'm compiling the latest git version right now
Last edited by Jeija on Tue Jan 03, 2012 17:52, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)

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

by Temperest » Post

Jeija wrote:
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.
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!
Yeah it is pretty similar, actually, but without channels, and range limited to one block.

I'll study your wireless stuff for more inspiration.

Crafting should also be simpler for these blocks, I think - I'll try a steel + mesecon combo.
WorldEdit 1.0 released

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

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

Hey Jeija, is it possible for a single node to be both a receptor and an effector?

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

@Gatharoth: It is possible, but it will make the game crash if the signal is conducted immediately. You have to set a delay.
Redstone for minetest: Mesecons (mesecons.net)

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

Alright. But that's kinda the point, delay :D

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

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

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

by Temperest » Post

Jeija 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.
Same reason as me, I guess :)

Making single block logic gates need that capability, or they will have to be directional.
WorldEdit 1.0 released

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

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests