Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digibuilder improvements #331

Open
Klaranth opened this issue Jun 23, 2023 · 6 comments
Open

Digibuilder improvements #331

Klaranth opened this issue Jun 23, 2023 · 6 comments
Labels
Discussion In-depth discussion with many comments Enhancement Improvements or changes to an existing feature

Comments

@Klaranth
Copy link
Collaborator

MCLV
it would be so nice if the digibuilder could get information on the inventory of a scanned item

BuckarooBanzai
Interesting, so you want to read chest-contents from afar, right?
Something like this?

digiline_send("digibuilder", {
  command = "getnode",
  pos = { x=1, y=0, z=0 }
})

if event.type == "digiline" and event.channel == "digibuilder" then
  event.msg = {
    pos = { x=1, y=0, z=0 },
    name = "default:chest",
    param2 = 0,
    inventories = {
      main = {
        "default:stone 50",
        "",
        ...
      }
    }
  }
end

Not sure about the performance though 🤔

SX
I guess performance would be somewhat similar to digiline chests, not good but still usable for some tasks.
Would it be better to create another mod for that, some digiline metadata reader mod?
Reasoning: There's a lot of things to consider when making decision if it is okay to return contents and if successful then it is possible that there will be a lot of custom handling for certain things.
For example locked wooden chests wont normally reveal contents to other players and been utilized to keep some things hidden.
(might even be such mod out there already)

MCLV
Anything that would allow players to mechanically read metadata whilst respecting privacy would be a good thing to have, rather yesterday than today in my opinion. Using a CSM, I've already been able to do it, but if I could build machines to do it that would open up a lot of possibilities and improve efficiency of a lot of new machine builds

SX
CSM still cannot read private metadata unless you wire it to server side mod.

MCLV
uhuh. normally indeed you can't. pretty safe imo

SX
Because metadata marked as private never leaves server without it being explicitly sent out-

MCLV
oh, really

SX
But thing is that most mods do not mark their metadata as private.
There however has been suggestion for engine to make private mode default, but that would probably cause many other issues (which would anyway be fixable in mod code).
I think lua controller memory is private.

MCLV
yes, that could very well explain why I can't see that

SX
https://github.com/minetest-mods/mesecons/blob/master/mesecons_luacontroller/init.lua#L611
But like said most mods do not use that and many modders do not even know it exists...

MCLV
Would it be an idea to create some new node that works like the node detector, but reads meta data ?
doesn't sound too hard to do. but I'm not really a modder just yet

SX
I think probably that would be best but also more work... after all it is very simple to read metadata and send it out. A lot harder to handle all special cases... Well, you could just take some simple digiline component like some memory chip from digistuff mod and dump fairly simple metadata reader there.
Then maybe change some textures...

Basics for inventory: meta = core.get_meta({x=0,y=0,z=0}); inv = meta:get_inventory(); lists = inv:get_lists(); lists["main"][0] == ItemStack("mod:item") (there can be multiple inventory lists, to get all loop is needed but often same name for containers)
Basics for other metadata meta = core.get_meta({x=0,y=0,z=0}); meta:get_string("owner") == "MCLV"; meta:to_table() == { ... eveything including private stuff ... }
And complete API: https://raw.githubusercontent.com/minetest/minetest/5.7.0/doc/lua_api.txt

@Klaranth Klaranth added Addition Idea for a new feature or item Discussion In-depth discussion with many comments labels Jun 23, 2023
@Klaranth
Copy link
Collaborator Author

Huhhila
BuckarooBanzai: Digibuilder setnode response message could mention any resulting items like trellis, beanpole, technic cans, empty buckets etc.

@OgelGames
Copy link
Contributor

I feel like that functionality would be better suited in a separate "inventory scanner" node...

@OgelGames OgelGames added Enhancement Improvements or changes to an existing feature and removed Addition Idea for a new feature or item labels Jun 23, 2023
@SwissalpS
Copy link
Contributor

slightly related BuckarooBanzay/digibuilder#14

@Klaranth
Copy link
Collaborator Author

Klaranth commented Jul 8, 2023

MCLV
What if... when the digibuilder is instructed to place a pickaxe, it instead digs the node at that location

@Klaranth
Copy link
Collaborator Author

birdlover32767
make digibuilder churn 1024 nodes per second
def not a lag machine

et
ok but seriously, buff it to like 3 nodes/0.5s

@OgelGames
Copy link
Contributor

You could just use more digibuilders :)

Also BuckarooBanzay/digibuilder#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion In-depth discussion with many comments Enhancement Improvements or changes to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants