Where is the selection box for wall mounted nodes?

Zen
Member
 
Posts: 14
Joined: Wed Feb 25, 2015 16:22

Where is the selection box for wall mounted nodes?

by Zen » Sat Sep 12, 2015 17:18

I’ve been typing in the tables for wall mounted nodes in minetest, but this makes for a rather large text file.
I’m wondering if the wall mounted tables exist, but require a different method of access than the ones I use for fixed nodes.
Attachments
identify.zip
Identifies the node a player is looking at, but not for all node types.
(10.56 KiB) Downloaded 80 times
Last edited by Zen on Sun Sep 13, 2015 02:15, edited 3 times in total.
 

BobbyBonsaimind
Member
 
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

Re: Where is the selection box for wall mounted nodes?

by BobbyBonsaimind » Sat Sep 12, 2015 17:34

Zen wrote:I’ve been typing in the tables for wall mounted nodes in minutest, but this makes for a rather large text file.


If possible, write a function to generate it for you. Easier to reuse, easier to change, write once, use everywhere.

Zen wrote:I’m wondering if the wall mounted tables exist, but require a different method of access than the ones I use for fixed nodes.


I'm not sure what you mean, but you can define different nodeboxes for when a node is wallmounted.

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
nodebox = {
    type = "wallmounted",
    wall_bottom = { ... },
    wall_side= { ... },
    wall_top = { ... }
}


On another note, your code is very interesting to read, a very unique and clean style. There are quite a few parts that could be simplified as far as I could see with some restructuring, but very nice to read.
 

Zen
Member
 
Posts: 14
Joined: Wed Feb 25, 2015 16:22

Re: Where is the selection box for wall mounted nodes?

by Zen » Sun Sep 13, 2015 02:15

BobbyBonsaimind wrote:
Zen wrote:I’m wondering if the wall mounted tables exist, but require a different method of access than the ones I use for fixed nodes.


I'm not sure what you mean, but you can define different nodeboxes for when a node is wallmounted.


I’m not wanting to define them.

I want to dig into the nodes registered in the minetest engine and access their definitions.
By crawling through the mesh node by node my algorithm finds the node highlighted by the user.
And, now that I’ve made some changes to the zip file above, the lamp now lights when looked at.
But the lamp is still a little buggy.

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
   if not (center == nil) then
      local name = minetest.get_node(center).name
      local selection = minetest.registered_nodes[name].node_box -- .selection_box -- .collision_box --
      if not (selection == nil) then
         for key, value in ipairs(selection) do
            message[3] = message[3]..tostring(key)
         end
      end
      message[3] = message[3].." C: "..tostring(minetest.registered_nodes[name].collision_box)
      message[3] = message[3].." N: "..tostring(minetest.registered_nodes[name].node_box)
      message[3] = message[3].." S: "..tostring(minetest.registered_nodes[name].selection_box)
      message[3] = message[3].." T: "..tostring(minetest.registered_nodes[name].selection_box.type)
      message[3] = message[3].." Z: "..tostring(minetest.registered_nodes[name].selection_box.wall_top)
   end

I’ve just discovered, by adding the code above to the file, that Regular and Wallmounted nodes
have hidden selection boxes in them, but there not like Fixed node selections boxes that I can read.
There’s no [1], [2], [3], [4], [5], [6] access.

I don’t know about Leveled nodes yet, I haven’t encountered them.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron