0
Answered

Optimise Flow by Selecting Different Options Based on Value

Eduard_de_Bruyn 2 years ago updated by Ex-Crow 2 years ago 5

Hi,

I'm creating a flow graph that converts a float to a string with a certain format based on a float value above a given range. I'm using Branch to check if the value is above X and then using ToString with the required format. See below -

There is an issue however. I already have over 10 of these flows and it's getting tedious to manage it.

How can I set this up in a more effecient way so that I could use one flow with all the values and outputs contained?

Bolt Version:
1.4.5
Unity Version:
2019.2.0f1 Personal Edition
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Answered

Hi Eduard!

It seems like you'll want to start using Super Units!

Here's a link to the manual: https://ludiq.io/bolt/manual/flow/super-units

Hi Lazlo, thanks for taking the time to answer.

I have tried using this in Super Units, and all of these flows sit inside 1 super unit so that I can link it to with the rest of the flow.

My question is how do I make this specific flow more effecient so that I don't have to have 10 flows (super units) to manage, but rather 1 flow with various values/attributes?

Hi Eduard,

I'm not sure I understand.

Are you creating the super unit as a Flow Macro asset in your project? This way, multiple super units point to the same graph, and you don't have to maintain multiple versions.

If it's an Embed, then yes, each super unit is different and it's not great for maintenance.

Create a macro superunit and connect all values you need to enter manually into input and mark the "has default value" checkbox but leave the actual value empty. 

Unrelated example but shows how it looks:




Also, if you want to repeat the same exact operation multiple times in a row but with different inputs you can use a For Loop. Here's a simple loop that resets the color of Buttons. The body could also contain a Branch unit that'd decide if the item in the list should be iterated on or not.