Open ricochet1k opened 7 years ago
This might be possible to implement, but I'm wondering if it's really required. Could additional, more complex aspects, for certain parts not be sufficient?
Well certainly, you could add an aspect that only exports items if the target inventory doesn't have that many already. Or just add an autocrafting system. But the whole reason I'm using this mod is that it seems to just give me the bare minimum of functionality and then lets us piece together what is necessary. Coming up with a complicated system to walk over each slot of the inventory, inserting an item if it exists, pushing that item onto a stack to construct if it doesn't exist, that sounds tedious, but it's actually fun.
If I wanted an easy "magical" way of autocrafting things, I'd be using Refined Storage.
That's not what I'm talking about. I am thinking about an additional aspect that is more expressive than for example the operator aspect from item exporters, which could for example also take a 'slot' parameter next to the 'item' parameter in the existing aspect.
Hmm, so something like returning a (Int, Item)
tuple of slot and item? Or are you referring to an Int -> Item
Operator? Or are you referring to an Aspect with multiple variable cards, one for item, one for slot, one for stack size, etc.?
If it's the third one, then I'm having a hard time seeing how that's different from allowing parameters to be configured with variables. Why not always do it that way? You can create constant variables pretty easily.
I'm referring to the second one, so an (Int -> Item) -> Boolean
operator.
That one makes me nervous. There are some very large inventories in some mods, such as Refined Storage or Colossal Chests. You could easily crash things or cause horrible lag if you try to use it on one of those.
I also hate that syntax. Int -> Item -> Boolean
makes a lot more sense. (Int -> Item) -> Boolean
implies that it's an x -> Boolean
, that accepts a (Int -> Boolean)
thing as a parameter.
Or wait, did you just mean Int -> Item
?
And still, what if I want to change the stack size that it moves? What if I want to craft 3 of an item, and so move 3 at a time to make it faster?
How about if I want to change the tick duration and tick delay of the Redstone Clock aspect? I may want to change it based on, how many of a certain item are available in a chest, for example.
You're right, there are some cases where variable-based aspect parameters are useful.
I'm however afraid that it's not a trivial thing to implement based on how ID currently works, but not impossible.
I'll leave this issue open, maybe I'll get to it sometime in the future. (Or feel free to have a try at implementing it yourself ;-) )
In my attempts to make an auto-crafting system with this mod, I have found myself wanting to modify the parameters of Aspects with variable cards.
For example: Use a counter of some sort to iterate over the slots of an Item Exporter's Export Item aspect. This could be used to, for example, export specific items to specific slots of an inventory, such as an Analog Crafter, from Extra Utilities 2 IIRC.
Other things this could be used for: changing the pulse delay of the redstone clock aspect, or changing the stack size of item export/import.