Download

pause/loop until a widget is no longer displayed?

Having a hard time… I have a loading screen that I put up when a map loads, that’s fine. There is a countdown screen that follows, it works fine … however, any client that connects when the countdown is in progress (in that state), has the countdown screen overlay the loading screen…

The countdown is set based on an state change, so if you enter the game when that state is in ‘countdown’, it throws up that screen…

Trying to figure out how to NOT put up that screen, until the loading screen is done (hidden or removed)… tried to ‘get visibility’ and use that in a while loop, but always get infinite loops… this does not function like actual code.

Any ideas how to sort of pause until a certain condition is met in BP?

The reason your while loop is being an infinite loop is that the condition is not changing within 250k loops, or however many it is. While loops are intended for the condition to change in the loop body, not outside of it, as the loops usually run from start to finish before allowing the rest of the code to execute, meaning that nothing can happen simultaneously (usually), which results in the condition remaining infinitely unchanged. I’d suggest for you to do a check every .5 seconds or so using a timer.

I could check it, but I can not figure out how to feed it back into the line of processing.

Could you post a screenshot of how you are using the loop right now? You could use a sequence, so first it does whatever, and then runs the timer.

I thought maybe this would work, but apparently I can not call this macro from a function… “Can not place macro instance with latent functions inside function graph!” …

But I can’t put the nodes inside my OnRep function because for some reason you can not create a ‘Delay’ node in them… argh.

loopit.png

The comment on the reroute is where I want it to ‘pause’ prior to loading the next widget…

loopit2.png

Yeah, there is no way to place latent functions inside of functions (Though you can call custom events that have latent functions). I’m really not sure how you should best go about doing this :expressionless: I would probably call a custom event that runs a macro to do everything this function is doing, but that is slightly hacky.

Figured it out. Indeed I needed to call a custom event from that OnRep rather than having the nodes in there. Now I get the two Widget references (turned out I needed to check two not just one), if neither is valid, then it goes on normally as neither can be displayed if they do not exist.

If either is valid it checks the visibility of both and NOR’s them into a Branch to ensure we only move on if neither is visible.

And if one is still visible and the branch fails, just wait a second then start the whole check over.

Thanks for your input.

ea14acd4a9fc904f4c093a2ef204820fb0c8bb97.png