View Single Post
05/12/14, 09:48 AM   #48
Roupine
Join Date: May 2014
Posts: 18
I've found that zo_callLater(fn,delay) works well for most of the things I used to use OnUpdate for. Especially if you're buffering OnUpdate to only run every so often, just replace it with a zo_callLater loop for the same length of time.

Code:
zo_callLater( MyMod:UpdateHandler, TIME_IN_MILLISECONDS )
Just add a zo_callLater() at the end of the UpdateHandler function to call itself again. It's still constantly looping a function, but it's a lot less often than 30-60 times a second.

TBH, the only reason I use OnUpdate anymore is to quickly run through a recursive set of functions that run too deep for the game to allow without external activation.
  Reply With Quote