Hi, this originally started as simple request to add parameter control to blueprints, then I figured I should at least offer my two cents on how you could implement the idea, and then I realized how much effort it actually is to make parameters as flexible as possible. I'm asking for a LOT of stuff here, and I understand if you just say "nah too much" lmao. I do think it would be a good idea though, and I'd love to discuss and try to simplify this. I'm certain I'm overengineering the idea in some places.
As far as I can tell, there's no way yet to adjust parameters of a blueprint when deploying (which is fine, there's hardly been any time to update).
It would be super nice to be able to do so, is this feature planned? I have a proposal for how the user-end of things could be.
I know of two types of parameters: constants and the special "parameter" signal which is replaced with another signal. I propose splitting these into two lists, retaining the order in which they're declared in a blueprint.
For the list of parameter signals, the deployer will assign signals to the parameter when a signal's value matches the index the parameter is at.
For the list of constants, the deployer will assign constants in order by reading the values of predefined signals (configurable in the deployer).
As an example, let's say we have a blueprint with five parameters (blueprint string will be put at end of post):
- Parameter signal 0
- Parameter signal 2
- Constant value (default 5)
- Parameter signal 1
- Constant value (default 4)
This blueprint is then placed into a deployer which has the following signals being sent to it:
- Electronic Circuit: 1
- Steel Chest: 2
- Iron Gear Wheel: 3
- Virtual A: 8
- Virtual B: 0
When activated, the blueprint will be placed using these parameters:
- Electronic Circuit
- Steel Chest
- 8
- Iron Gear Wheel
- 0
NOTE: The number IDs of the parameter signals don't match the order the blueprint declares them, hence why Steel Chest goes to the second listed parameter signal, rather than "Parameter signal 1". I think this is desirable behavior, as it should play nice with mods that may add more parameter signals.
For this to work, the block would need some reworking with how it handles its "configuration" signals like X, Y, etc. For the most flexibility, I think these are things that should be configurable in the block itself with a panel on the right side, much like the roboport.
Basically, each signal type which currently has hardcoded behavior would become something you can define the signal for, and maybe even further you could customize which color these values are read from. For example, the deployer could be set to read its X and Y offsets from Virtual A and Virtual B instead, and only on the red wire. And regarding constant assignment, above I used Virtual A and Virtual B to assign the two constant values, but I think these could also be configurable in the same way. So you could define it to instead read constants from the Iron Plate and Copper Plate signal as the first two. This would also allow the block to trigger on a different signal type, making obsolete the map setting that determines whether Virtual 0 or Construction Robot starts blueprinting. It would ALSO make the deployer itself something that could be parameterized. I have no idea why you would use that, but I'm sure some mad genius out there can make use of it.
Basically: every signal the deployer already responds to would become configurable in the UI and parameterizable. The deployer would also gain options to filter reading from red or green for those options, as well as for the new options which determine which signals (and in which order) constant values are read from, and which color will be read from to assign parameter signal types. As one final option, you could also make it so that the default constant values can be read into signals (but maybe that's too much with everything else I've said..)
Thoughts?
BP Code: https://pastebin.com/dZkdqDC4