Unlimited Parameters: Dynamic Expansion of Parameters
Posted: Tue Nov 19, 2024 12:16 pm
TL;DR
Allow blueprints to dynamically expand parameters at placement, generating additional parameters within the same blueprint element. This removes the need to predefine a fixed number of parameters during design and supports scalable, modular setups.
What?
Introduce a feature where a single parameter acts as an expandable source (e.g., Cargo), dynamically generating additional parameters at placement. Each new parameter (e.g., Cargo 1, Cargo 2, Cargo 3) inherits the base parameter’s properties and integrates horizontally into the assigned blueprint element, such as names, signals, filters, or icons.
Unused parameters in expandable parameters default to "Hide on Blank", ensuring only provided values appear in the final blueprint.
In the Editor:
- The designer defines a parameter (Cargo) with an "Expandable" setting ticked.
- This parameter is inherently assigned to a blueprint element (e.g., train station names, combinators, or filters).
At Placement:
- The system starts with one input and dynamically adds more as the user provides values.
- Each input generates a distinct parameter (Cargo 1, Cargo 2, Cargo 3, ...), expanding within the same blueprint element.
- If a value is left blank, expansion stops, and unused parameters are hidden.
Example Use Cases:
1. Train Station Names :
- Parameter: Parameter 0 in Station Name
- Parameter Inputs: Iron, Copper, Coal
- Result: Train Station Name = IronCopperCoal
2. Constant Combinator Signals:
- Parameter: Signal
- Parameter Inputs: Iron, Uranium
- Result: Constant Combinator outputs signals: Iron, Uranium
Why?
This feature would make blueprints more flexible and modular by abstracting manual design work for parameter variations into the blueprint parameters themselves. Similar to variadic arguments (**kwargs), it allows blueprints to handle an arbitrary number of user-defined inputs at placement dynamically, expanding parameters contextually within their assigned elements.
Instead of requiring users to manually create multiple versions of the same blueprint for different input configurations, dynamic parameter expansion allows a single blueprint to address various specific needs with minimal effort, reducing unnecessary clutter and duplication