Is there an inverse branch node?

This should be simple enough. Is there something that works like an inverted branch?

so two execution lines come in, one goes out, and depending from which one it came it’ll set a different boolean value.

I suppose I could set a boolean variable to true after one and false after the other, but I don’t really need to have a local variable for that since it’ll only be sending the value to another BP and it’ll be used in a branch there.

(edited title and screenshot as it was causing confusion)

Ended up making a macro like this:

Based on another post here.

Kinda wanted it to be a global function rather than a local macro, but oh well I guess you can’t have two execution inputs in a function?

While it is probably true that you can’t make a function with two execution inputs, you can make that macro globally available by creating a ‘Blueprint Macro Library’. It’s in the Content Browser right-click menu under ‘Blueprints’.

I realize that, but a macro library needs to inherit from some class, and the macros will only be available to that class, so not really global like functions (at least as far as I know…?)

Unless… What if I set it to inherit from Actor :thinking:

well it kinda worked… then when I tried to save my game instance:

What if either of the events are called twice in a row? Then your function is “bugged”. This is a very bad way of making custom events making the caller able to break your logic.

Make two separate flows where one always create Load Menu and the other always create a Save Menu.

If you insist on mixing these two Custom Events then set a bool at the Beginning of the Events and use that throughout but then DO NOT use any latent functions or this will also break.

1 Like

Can’t it be set to inherit from Object? then it would be global to everything. You should look at the library that has the for-loop and for-each macros in them.

Sorry I can’t help with the error. Again I’d suggest looking at for-loop and for-each since it doesn’t seem like you’re doing anything particularly different than what they are doing.

GarnerP57 makes a good point about this setup and the dangers when interacting with latent function though.

1 Like

I don’t think I follow. What would be the problem if either events were called twice in a row?

Your second custom macro would work okay, I was referring to your first post sorry.

ah ok I was just trying to show what I wanted

actor is child to object, lots of blueprints don’t inherit from actor, including widget.

object is the base to all of them, so if it doesn’t work when parented to object then I suppose it’s not possible

Why don’t make it like this? Your concept is prone to bug.
image

If you afraid bugged if one of those event executed twice, use a function to make sure the widget is being constructed once.

And call Save/Load setup when load or save is being called.

1 Like

sure, I could have done it many other ways, just thought that this simple macro would make things way simpler.

can you elaborate on how it would bug?

If one of the event executed twice, the widget will also created twice or called the load event then call the save event (without closing the previous widget) could also created the widget twice with save and load setup.

Btw, I thought you wanna connect load and save to a exec pin of flipflop and call save or load based on A bool condition, I didn’t see your second post of the macro.

1 Like

right yeah. I edited the “flip flop” out of the original post since it was causing confusion