[BUG] Looping "set ultimate charge" action causes buggy behavior

It took me a long time to suss this out but I’m now convinced that setting a looping set ult charge action can cause other script to bug out in your game. The custom ultimate system in my game has various actions that will add numbers to a variable as well as a looping passive charge that adds 1 to the variable every 2 seconds. Then I have a separate rule that will set the player’s ult charge as that variable and this loops every 0.2 seconds. All built-in ultimate charging is turned off, it’s only using the workshop code. Everything about this works fine.

However, when that looping set ult charge rule is active I see various other issues in the game that otherwise make no sense. Rules that trigger with a button press will sometimes trigger on their own, abilities that get set back to enabled will sometimes immediately trigger on their own, teleportation won’t always work, and so on. But when I have that set ult charge rule toggled off then all of these issues go away.

It’s possible that it’s not just the looping rule but maybe it plus something else. But as far as I can tell turning that one rule off is the only thing that stops these bizarre problems. I found work arounds for most of the issues it causes but just wanted to share my findings.

Maybe the loops on each player causes to much server load. You could try to replace the “update ult charge” loop with a rule that only triggers on the condition: ultimate charge percent(event player) != player variable(event player, ultcharge)

So instead of setting the ultcharge 5 times a second you would only set it every 2 seconds + the other ult increase events you have.

Only one handler will get triggered each frame, if I haven’t gone completely senile. The conditions will be tested top-down, and the first one to eval true will execute.