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

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

by Gatharoth » Post

Okay, I'm getting a weird error. mesecon:register_on_signal_on isn't working anymore for me.

I've been working on an addon to temperest's code. (see here) When all of a sudden I get this error.

Code: Select all

01:31:14: ERROR[main]: [LUA] ...inetest\bin\..\data\mods\mesecons_temperest\init.lua:323: attempt to call method 'register_on_signal_on' (a nil value)
This happens even when I put the function inside it.

So like

Code: Select all

mesecon:register_on_signal_on(function(pos, node)
    if node.name=="mesecons_temperest:duali" then
    minetest.chat_send_player("Gatharoth", "running check.")
        if check_dual(pos) then
            local 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
        
            local 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
        
            local 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
        
            local 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
        end
    end
end)
Still ends with the same error.

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

by sfan5 » Post

Gatharoth wrote:Okay, I'm getting a weird error. mesecon:register_on_signal_on isn't working anymore for me.

I've been working on an addon to temperest's code. (see here) When all of a sudden I get this error.

Code: Select all

01:31:14: ERROR[main]: [LUA] ...inetest\bin\..\data\mods\mesecons_temperest\init.lua:323: attempt to call method 'register_on_signal_on' (a nil value)
This happens even when I put the function inside it.

So like

Code: Select all

mesecon:register_on_signal_on(function(pos, node)
    if node.name=="mesecons_temperest:duali" then
    minetest.chat_send_player("Gatharoth", "running check.")
        if check_dual(pos) then
            local 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
        
            local 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
        
            local 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
        
            local 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
        end
    end
end)
Still ends with the same error.
The Function just don't exist.
Something must be wrong with the Mesecons init.lua
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Hackeridze
Member
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Post

Last edited by Hackeridze on Fri Mar 16, 2012 14:25, edited 1 time in total.
My game: RTMG
GENTOO USER

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

by Gatharoth » Post

sfan5 wrote:The Function just don't exist.
Something must be wrong with the Mesecons init.lua
The problem is, it does exist; And it works. If I take out my code, and let it load, calling that function works. I mean, if you want proof, here it is in the movesontes.

Code: Select all

mesecon:register_on_signal_on(function (pos, node)
    if node.name=="mesecons_movestones:movestone" then
        local direction=mesecon:get_movestone_direction({x=pos.x, y=pos.y, z=pos.z})
        local checknode={}
        local collpos={x=pos.x, y=pos.y, z=pos.z}
        repeat -- Check if it collides with a stopper
            collpos={x=collpos.x+direction.x, y=collpos.y+direction.y, z=collpos.z+direction.z}
            checknode=minetest.env:get_node(collpos)
            if mesecon:is_mvps_stopper(checknode.name) then 
                return 
            end
        until checknode.name=="air"
        or checknode.name=="ignore" 
        or checknode.name=="default:water" 
        or checknode.name=="default:water_flowing" 
        minetest.env:remove_node(pos)
        nodeupdate(pos)
        minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
    end
end)

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

by sfan5 » Post

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

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

by Temperest » Post

Gatharoth wrote:
sfan5 wrote:The Function just don't exist.
Something must be wrong with the Mesecons init.lua
The problem is, it does exist; And it works. If I take out my code, and let it load, calling that function works. I mean, if you want proof, here it is in the movesontes.

Code: Select all

mesecon:register_on_signal_on(function (pos, node)
    if node.name=="mesecons_movestones:movestone" then
        local direction=mesecon:get_movestone_direction({x=pos.x, y=pos.y, z=pos.z})
        local checknode={}
        local collpos={x=pos.x, y=pos.y, z=pos.z}
        repeat -- Check if it collides with a stopper
            collpos={x=collpos.x+direction.x, y=collpos.y+direction.y, z=collpos.z+direction.z}
            checknode=minetest.env:get_node(collpos)
            if mesecon:is_mvps_stopper(checknode.name) then 
                return 
            end
        until checknode.name=="air"
        or checknode.name=="ignore" 
        or checknode.name=="default:water" 
        or checknode.name=="default:water_flowing" 
        minetest.env:remove_node(pos)
        nodeupdate(pos)
        minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
    end
end)
I think it might be helpful if you posted the entire file somewhere, maybe the issue is with where it was put? I'm no Lua expert, but that code looks perfectly fine to me by itself.
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

sfan5 wrote:Weird!
Could it be that I'm calling it, after it's already called?

I'm adding to temperest's code; just something that will strickly be used for things like in his OGAM. And it's called there once already.

But then again, it was working fine until I tried to set the mesecon_on to a local and see if that would fix the problem I was having before this. Which was "if" functions were failing even though everything should have matched up correctly.

@Temperest

All of the code is at here

The only changes to it are names, and its put right under your code.



EDIT: Alright, for what every reason its all working now. Everything!! :D
Last edited by Gatharoth on Fri Mar 16, 2012 18:52, edited 1 time in total.

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

by Temperest » Post

Gatharoth wrote:EDIT: Alright, for what every reason its all working now. Everything!! :D
Must be the magical code gremlins again.
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

Temperest wrote:
Gatharoth wrote:EDIT: Alright, for what every reason its all working now. Everything!! :D
Must be the magical code gremlins again.
IKR!? Scary little bastards. lol

User avatar
celeron55
Administrator
Posts: 533
Joined: Tue Apr 19, 2011 10:10
GitHub: celeron55
IRC: celeron55

by celeron55 » Post

Missing license information; please fill in ASAP.

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

by Jeija » Post

Filled in the license; as you might have noticed I'm currently away; if there is anything that has to be changed, could please sfan5 or Temperest commit it on GitHub?
I did not read the whole thread since then but I think there was some bug and there is another thread with an AND gate; if there is any code to commit please do it!
Redstone for minetest: Mesecons (mesecons.net)

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

by sfan5 » Post

Jeija wrote:Filled in the license; as you might have noticed I'm currently away; if there is anything that has to be changed, could please sfan5 or Temperest commit it on GitHub?
I did not read the whole thread since then but I think there was some bug and there is another thread with an AND gate; if there is
any code to commit please do it!
Welcome back!
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

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

by Temperest » Post

WorldEdit 1.0 released

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

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

by sfan5 » Post

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

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

Meselamps do not work, fix it please.

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

by Temperest » Post

xyz wrote:Meselamps do not work, fix it please.
Fixed.
WorldEdit 1.0 released

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

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

Idea for wireless.
Have a number on the inverter, transmitter, or receiver. Every time you punch the block it increases by one; this is it's channel. A transmitter on channel 1, is received by inverters and receivers on channel 1.

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

by Temperest » Post

bgsmithjr wrote:Idea for wireless.
Have a number on the inverter, transmitter, or receiver. Every time you punch the block it increases by one; this is it's channel. A transmitter on channel 1, is received by inverters and receivers on channel 1.
We already have channels; if you place a transmitter on glass, only receivers placed on glass will receive signals from this transmitter. I personally think this is easier to use than explicit numbers.
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

Temperest wrote:
bgsmithjr wrote:Idea for wireless.
Have a number on the inverter, transmitter, or receiver. Every time you punch the block it increases by one; this is it's channel. A transmitter on channel 1, is received by inverters and receivers on channel 1.
We already have channels; if you place a transmitter on glass, only receivers placed on glass will receive signals from this transmitter. I personally think this is easier to use than explicit numbers.

Easier to use, yes. But purposes a limit, where as explicit numbers wouldn't have this limit, but wouldn't be very easy on the end-user.

With numbers, you could have a channel for every node in the entire world, which is roughly 238,328,000,000,000(1) channels. Course that would roughly be the entire world of nothing but transmitters, and no room for a player, or any other nodes.

Both cases have strong points and weak points.

notes:
(1): Rough estimate based on the statement "Almost infinite world (limited to +-31000 blocks in all directions at the moment)" 62,000^3
Last edited by Gatharoth on Tue Mar 20, 2012 22:30, edited 1 time in total.

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

by Gatharoth » Post

Here's a bug I noticed while playing in singleplayer (not advanced!). For what ever reason, I cannot dig any of the mesecons' nodes. Tried all tools in default, as well as barehanded. Cannot dig them up.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

replace all the digprop blah blah stonelike
with groups = {snap=1, crackle=2, pop=3}
lol. cracky, snappy, crumbly

Sartan
Member
Posts: 12
Joined: Tue Feb 28, 2012 23:47

by Sartan » Post

Can give on a reference on the working version of transmitters, receivers and Inverters?

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

by Temperest » Post

Gatharoth wrote:Here's a bug I noticed while playing in singleplayer (not advanced!). For what ever reason, I cannot dig any of the mesecons' nodes. Tried all tools in default, as well as barehanded. Cannot dig them up.
This has been fixed, and mesecons is now compatible with the latest build.
Last edited by Temperest on Thu Mar 22, 2012 21:53, edited 1 time in total.
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

Wow thanks a lot Temperest!! This must have been a lot of work!!!
Btw I'm back now and I'm really surprised and happy about the progress that minetest has made.
Redstone for minetest: Mesecons (mesecons.net)

mrgasp
Member
Posts: 33
Joined: Sun Jan 15, 2012 23:30

by mrgasp » Post

Temperest wrote:
Gatharoth wrote:Here's a bug I noticed while playing in singleplayer (not advanced!). For what ever reason, I cannot dig any of the mesecons' nodes. Tried all tools in default, as well as barehanded. Cannot dig them up.
This has been fixed, and mesecons is now compatible with the latest build.
Thank you, my server is fixed now :D
Hosts a MineTest server: http://c55.me/minetest/forum/viewtopic.php?id=833
Frequent Backups, Little Load, Fast Network! Come join today, what will you lose? Your cached textures? oO O noes.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 37 guests