[Digilines] wire rules, connecting nearby nodes

Post Reply
nocturnalwizard
Member
Posts: 15
Joined: Wed Jan 18, 2023 20:34
GitHub: nocturnalwizard
In-game: nocwiz

[Digilines] wire rules, connecting nearby nodes

by nocturnalwizard » Post

I'm attempting to create my own digilines-compatible node based on the digiline distributor from the streets mod. It is defined as follows:

Code: Select all

minetest.register_node(":streets:digiline_distributor", {
  description = "Digiline distributor",
  tiles = {
    "streets_lampcontroller_top.png",
    "streets_lampcontroller_bottom.png",
    "streets_lampcontroller_sides.png"
  },
  groups = { cracky = 1 },
  drawtype = "nodebox",
  paramtype = "light",
  node_box = {
    type = "fixed",
    fixed = {
      { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
      { -0.05, 0.5, -0.05, 0.05, 1.6, 0.05 }
    }
  },
  digiline = {
    wire = {
      rules = {
        { x = 0, y = 0, z = -1 },
        { x = 0, y = 0, z = 1 },
        { x = 1, y = 0, z = 0 },
        { x = -1, y = 0, z = 0 },
        { x = 0, y = 2, z = 0 }
      }
    }
  }
})
This node allows you to place a node "below the surface", stack another node on top (e.g. dirt), and then stack a conductive pole above that. This seems to be made possible by the last digiline wire rule (where y = 2), however I am attempting to extend this functionality so that it also makes a connection to a node below with no luck. Basically, I hate digiline/mesecon "wires" because, in this particular example, they prevent me from placing a node next to this one. I've dug through all of the code and am struggling to understand how the wire rules work. It seems as though I should be able to simply add:

Code: Select all

{ x = 0, y = -1, z = 0 }
or perhaps

Code: Select all

{x = -0.5, y = -1, z = 0 }
to achieve this, however I've tried everything imagineable and seem to have no luck. I have a luacontroller placed directly below this node that outputs a digiline_send, and I want to be able to pick up on that signal from this node placed directly above it without a physical (e.g. mesecon/digiline wire) connection.
example.jpg
example.jpg (311.35 KiB) Viewed 499 times
Is there any way to make this happen?

Edit: I've made it as far as figuring out that both nodes in the "connecting" pair need to have their "range" extended, at least, I think this is the case. I've modified the luacontroller to add a "port":

Code: Select all

local rules = {
	a = {x = -1, y = 0, z =  0, name="A"},
	b = {x =  0, y = 0, z =  1, name="B"},
	c = {x =  1, y = 0, z =  0, name="C"},
	d = {x =  0, y = 0, z = -1, name="D"},
	e = {x =  0, y = 1, z =  0, name="E"}
}
Now, I don't know whether this was the correct way to add an additional connecting point to the luacontroller, but it works like so with a light node placed 1 full block above the luacontroller:
example2.jpg
example2.jpg (114.07 KiB) Viewed 470 times
However, when I attempt to connect it using my "digiline distributor" node (described above), it no longer works:
example3.jpg
example3.jpg (129.05 KiB) Viewed 470 times
All I can figure is that the "wire rules" for my "digiline distributor" must be wrong, but like I said, I've tried every imaginable combination of rules and can't seem to get it to work.

Any help would be greatly appreciated.

Edit 2: I forgot to include my current wire rules for the digiline distributor definition, which are quite expansive, and borrowed from the related ltc4000e mod and expanded on to hopefully achieve a further "reach":

Code: Select all

-- Around the bottom
{ x =  1, y =  0, z =  0 },
{ x = -1, y =  0, z =  0 },
{ x =  0, y =  0, z =  1 },
{ x =  0, y =  0, z = -1 },

-- Further around the bottom
{ x =  1, y = -1, z =  0 },
{ x = -1, y = -1, z =  0 },
{ x =  0, y = -1, z =  1 },
{ x =  0, y = -1, z = -1 },

-- Even further around the bottom
{ x =  1, y = -2, z =  0 },
{ x = -1, y = -2, z =  0 },
{ x =  0, y = -2, z =  1 },
{ x =  0, y = -2, z = -1 },

-- Around the top
{ x =  1, y =  1, z =  0 },
{ x = -1, y =  1, z =  0 },
{ x =  0, y =  1, z =  1 },
{ x =  0, y =  1, z = -1 },

-- Further around the top
{ x =  1, y =  2, z =  0 },
{ x = -1, y =  2, z =  0 },
{ x =  0, y =  2, z =  1 },
{ x =  0, y =  2, z = -1 },

-- Straight out of the top/bottom
{ x =  0, y =  1, z =  0 },
{ x =  0, y =  2, z =  0 },
{ x =  0, y = -1, z =  0 },
{ x =  0, y = -2, z =  0 },

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests