I've been using this forum as a reference for a couple of years and decided to finally register. Love AC and this forum has been incredibly helpful.
I am trying to make an ActionList that waits for ANY other active ActionList to finish before then running itself. Between what's available in AC and the custom scripting I've seen, it all seems doable but I'm not finding a clear path.
I have a scene with a countdown timer gameplay element and when the timer reaches zero it runs an ActionList. But, by design, any number of other ActionLists could already be running. Rather than kill all these ActionLists, I would like the Timer ActionList to wait for any of these other ActionLists to finish running before it then runs itself.
I looked into using "Run in Parallel" but I don't think it's exactly what I'd need. Plus it only has 10 slots and the scene has dozens of potentially active ActionLists.
I'm not much of a coder but have done some custom scripting. It looks like I could potentially use
"AC.KickStarter.stateHandler.IsInCutscene ();" or "AC.KickStarter.stateHandler.IsInGameplay ();"
to determine if any other ActionList is running but I wasn't sure how to then allow any running ActionLists to essentially "wait until finish" before running the other List.
Hope this makes sense. Any help would be greatly appreciated!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Ronginald.
This is possible with a custom Action by iterating through the ActionListManager's record of active ActionLists, and comparing it with the one that the Action is from.
This should do it:
Save this in a file named ActionWaitOthers and install it following the guide here.
Oh wow! Thank you so much. This does exactly what I needed!
And if there were any exceptions where I realized I wanted one or two specific scripts NOT to complete, I just manually Kill those before I call "Wait for Others."
Incredible! Thanks again! My hope is to learn enough to give back to the forum some far distant day instead of just taking.