Itemstacks already have count, I don't see a reason to add count as an extra parameter.auouymous wrote:stackitem and count parameters.
Pipeworks has connected_sides to decide on which sides a tube may connect to the node.auouymous wrote:Could you elaborate?DS-minetest wrote:Also pipeworks has connected_sides. Maybe rules like the one from mesecons would make sense (think of nodes that span several nodes and co.).
There could be rules in form of vectors that point to a position relative to the node's position. Mesecons does the following: If the node at the position that the rule points to has a rule that points back, then the nodes are connected and signals will be transferred between them. The rules can also be given with a function.
This might contain mistakes. Don't waste your time reading too carefully:
Eg. node A has the rules {{x = 1, y = 0, z = 0}, {x = -1, y = 0, z = 0}} and node B has the rules {{x = 1, y = 0, z = 0}, {x = 0, y = 0, z = 1}}. Now there's an A node at (0,0,0), an A node at (-1,0,1) and a B node at (-1, 0, 0). The node at (0,0,0) is now turned on, so go through the rules: There's no node at (1,0,0) that has rules, but there's one at (-1,0,0), and it has a rule to (0,0,0). Turn that node on: The node at (0,0,0) is already on, there's a node at (-1,0,1) (=(-1,0,0)+(0,0,1)) that has rules. Does it have rules to (-1,0,0)? No. End here.
My idea is to add input_rules and output_rules that are used for connection of tubes and co. and that are checked before calling can_take or can_put and that are numbered so that this number can be given to the callbacks.
This probably might be is a bad idea. >_<
But at least there should be a callback that mods can call to see if there should be a connection to and/or from a side.
Like mod A has a taker and a putter and wants to see if they should visually (and hard) connect to the side of the node from mod B they are placed to.
Just something like can_connect(side) -> bool, bool.
What about nodes that want to cycle through inventory slots or do other special stuff?auouymous wrote:Node-IO was designed to put the inventory node in control, because some inventories don't use an invref. When a transfer node puts an item in a side, it is up to the inventory node where that items goes. Taking anything is the same as putting, you just ask for something from a side and the inventory chooses what you get. But a transfer node with a filter or inventory needs to know what it will get to either filter the take or verify the take will fit in its own inventory. So Node-IO has read-only callbacks to query the contents of fake inventories attached to a given side. The transfer node can then call take_item with a stackitem that filters exactly what it receives.DS-minetest wrote:pipeworks uses return_input_invref or decides on its own to choose from what inventory to put. Nodes should choose on their own where to put the item they get to. But if another node takes from a node, the taking node (or any other taker) might want to decide on its own from where to take. There should be a callback to give an invref and a listname to help the taker.
I think, I was asking for approximately what you described but in a much more generic way. Eg. if a mod calls the put callback with custom = "fuel", the receiving node should put the item into its fuel slot.auouymous wrote: I was thinking about adding named inventories though. A transfer node would query available named inventories and then request a specific inventory to put or take. A smart pipe could be connected to any side of a furnace and the player could configure the pipe to filter fuels to the fuel inventory, ores to the src inventory and take from the dst inventory. These named inventories don't represent invrefs, they can be fake or have different names than the invrefs. And the inventory remains in control, if the furnace only wants to receive fuel from top it will only expose the named fuel inventory on that side. Dumb pipes would operate as they currently do without named inventories.
Is this something I should add?
I'm not sure what you are asking for.DS-minetest wrote:Perhaps the callbacks should get custom string parameters where mods can add some information that might be handled by the getter or taker. (Think of a fuel putter device that adds "fuel".) Just don't use the 4th or whatever parameter and call it "custom".
If putter/taker is used for the allow_metadata stuff, it's a bit like the owner thing.auouymous wrote:Putter and taker is for logging and allow_metadata_whatever callbacks. I don't see the point of pipeworks' owner parameter, it is only for putting but not taking. Hoppers allow putting in locked chests but won't take from them, makes sense if the locked chest isn't protected and you want someone to place a hopper and fill it up. Pipeworks' owner could be used by locked chest to only allow a pipe placed by the chest owner to insert items, but it doesn't pass owner when removing which could have been used to allow an injector to take if both have same owner. I don't think node-io should care who owns what, it doesn't matter for single player, and you should be using protection mods on multiplayer. And multiple players sharing a protection will have issues if one of them places inventories and the other places the pipes. Let me know if this is wrong and there is a valid reason to pass owner.DS-minetest wrote:The putter is a fake player it's documented. I first thought that was the equivalent to pipeworks' `owner` which is important. What is the putter for? Would it make sense to add a helper to create a fake_player?
A utility function to create fake players isn't needed. A mod either has a real player or it passes nil. And any mod that stores owner in nodes probably already has a way to create fake players for its own logging/allow_metadata_whatever.
Does it make sense btw that mods call allow_metadata_…? Isn't this just for the case that a player accessed an invref that he shouldn't have access to? Mods can decide on other ways if a player (with a given name) should be able to manipulate inventories.
Real player or nil is not a fake player. And if the player disconnects, the taker/putter won't exist anymore which is not good. Ergo player names make more sense imo.
Note, that the pipeworks api is all but perfect. The taker would probably be useful, too.
Here is the PR that added owner. There's also a use example linked: wifi chest
America is not the world. In this case they are the minority. Nearly all countries in the world use the metric system. Imo this is no valid argument.auouymous wrote:Most Americans don't know what a liter is or even what milli means.DS-minetest wrote:I'm not totally against millibuckets and not for liters (and of course not for millicubicmeters or cubicdecimeters). Or what about mn (millinode)?
If a person doesn't know what "liter" (= 1 (dm)³) or the prefixes "milli", "giga", "femto", "nano" and co. mean, he or she can learn it easily. It will be useful information for their whole life.
There are games that have no bucket. There might also be games that have a bucket that doesn't simply store exactly one source of liquid.auouymous wrote:All players do know what a bucket is
The mods that use the api don't have to display their liquid with the same unit as API does. A discussion about "millibucket" is actually not really important in here. Just define clearly what the unit means.
Minetest is not minecraft. In minetest there never was a really good liquid transferring via pipe mod that would need units like "millibucket". The mB unit name came mostly from mc afaik. For esthetic reasons and because MTG is not the only game I would prefer another unit name.auouymous wrote:The mB unit name has been around for years in minecraft, and probably the same in minetest, you can't change it now.
I'm sorry for causing misunderstanding. This was not about energy but that from the eu terminology (unit name = what the unit describes .. "unit") that is used eg. in technic. You could do the same for liquid volumes.auouymous wrote:Energy can be registered like a liquid, transfered in liquid pipes and stored in liquid tanks or buckets. Doing so forces it to use mB, because that is what liquid nodes display.DS-minetest wrote:What about unit for energy = eu => unit for volume = vu => millivolumeunits (mvu)?
Or node-io could get an energy API identical to its liquid API. The liquid and millibuckets parameters become energy and quantity/count/whatever. The energy name would be something like "buildcraft:MJ" but nodes that display energy would strip off the colon and everything before it, displaying "50 MJ". "buildcraft:MJ" and "industrialcraft:EU" could be transfered over the same energy pipes, just as lava and water can over liquid pipes, but not at the same time. Every mod that creates its own energy gets to name it, so MJ for buildcraft, EU for industrial craft and RF for thermal expansion. I could create a machine and have it optionally depend on multiple energy mods and accept energy from any of them. But MJ might be easier to create than EU, so each operation requires 75MJ or 50EU. Energy is like liquid and food, lots of flavors. Try telling mod authors that only one food type is needed in the game... ;)
I'm against copying minecraft mod things. The minetest community is small and has to focus its modding into a few mods to make these good. Ergo. the minetest community is united and can mainly use one (fictive) metric system. Minetest: quality; minecraft: quantity.
I might have overlooked some points, sorry. >_< This made me tired.