Help an old fart understand: Branches in Blueprints
If I directly convert the following condition to blueprint nodes:
If first_circle_event is still at the default value of -1 I would expect the condition to pass as soon as it gets to the first_circle_event === -1 and not bother evaluating the following conditions which rely on first_circle_event being a valid index. However when I use a single branch all conditions are evaluated and warnings are thrown.
If I replace this with three sequential branches then I don't get these warnings, all is logical but now I have three nodes each with their own paths and it's less clear what is going on at a glance.
Am I getting this right? I'm not looking forward to updating all my branches but I don't want to simply suppress warnings either. Is there a way to enter a conditional formula that creates a single collapsed macro node like the Math Expression Node? Any other approaches that may be attractive to a very lazy person? Or should I just stop being precious, blow the cobwebs off my brain and get with the program?
asked Jan 23 '19 at 10:25 AM in Blueprint Scripting
To my current understanding of how blueprint works:
When the execute path hits the branch, every node and sub-node that connects to that boolean input is evaluated.
So while you expect First_Circle_Event == -1 to be true, and the execute to move to the next node beyond the brach, that is not the case as every other node connected to the OR-node is also evaluated. So in that same instance where First_Circle_Event == -1, the blueprint will at the same time evaluate Get[-1] from CircleEventsArray which is causing you that error.
By changing your branches to the Treble-switch setup, at each branch you will evaluate the connected sub-nodes, meaning you will never try to get[-1] from the array in the same instance where First_Circle_Event is equal to -1.
This is simply how Blueprints functions, so I'm not sure if it helps solve your problem but at least I hope it helps you understand the root of your issue.
Follow this question
Once you sign in you will be able to subscribe for any updates here