Else if is broken
-
@Deeeds I know, it’s useful, but everything you can do with an Else If you can do without, using more Ifs instead (with more behaviours though).
-
@Aidan-Oxley this isn't true when you don't have AND or OR
-
@Deeeds Give me a condition that you think could only work using an Else If. I could do it without Else If, using a bunch of Ifs.
-
@Aidan-Oxley else... try just to do else... around ranges.
You'll wind up in a sea of spaghetti not even you can debug in hyperPad.
-
@Deeeds All my projects when needing conditionals use Ifs only, I never use Else If. It doesn’t cause mess/spaghetti, it causes one or two extra behaviours.
-
@Aidan-Oxley Again... try doing else, around ranges. It's not nearly as simple as the situations you're describing.
-
@Deeeds I’m pretty sure I have. You wanna screenshot? It’s spaghetti, no matter if I use Else Ifs or not. And if for some reason I haven’t, I’m very sure I can.
-
@Aidan-Oxley
You're going to regret this...
Here's just two:
@Aidan-Oxley
If speed is less than 10 but more than 2 OR less than -2 and more than -10, AND rotation is greater than 20 but less than 40 OR less than -20 and greater than -40
else if speed is less than 20 but more than 10 OR less than -10 and more than -20 AND rotation is greater than 40 but less than 80 OR less than -40 but more than -80
else
etc...
-
@Deeeds Challenge accepted.
-
This post is deleted! -
@Deeeds How’s this?
-
@Aidan-Oxley Where is "else"?
-
@Deeeds It’s implied by the behaviours. Both conditions cannot be met at the same time, so I don’t need any else. If one of the sides of this particular Else happens, the other cannot.
-
@Aidan-Oxley Huh?
I'm confused.
Else, in my example, is everything else. Outside these ranges.
You've helped me see that you and I should help the lads design a better conditional node.... behaviour.
-
@Deeeds The conditions you asked me to make can only be one or the other, there was no reason for me to put anything in to do “Else”. Speed cannot be between 2 and 10 but also 10 and 20 at the same time, so I don’t need to have an Else between them. Makes sense?
-
@Deeeds Oooohhh I think I understand now, you have 2 else’s between 3 bunches of conditions. You want another condition for if all that junk isn’t true. Gimme a sec I’ll give another screenshot.
-
@Deeeds This could’ve been done with a tonne more Ifs, but I can just disable behaviours, then enable them again once they’ve been missed. Taking advantage of how hyperPad executes behaviours.
-
@Aidan-Oxley I'm 99% sure your Else, in this situation, will get invoked (called) before the ifs reach a conclusion that they should turn your Else behaviour off.
-
@Deeeds Already checked that. I gave speed and rotation a value, then made Else and Stuff behaviour bundles have some visual effect behaviours, and it all worked as intended.
-
I really like how neat the execute sequence of behaviours is!