My understanding was that this function would register for an update to occur X seconds in the future, whereupon the OnUpdate Event would be called. It would do this only once, unless, during the course of script execution, another RegisterForSingleUpdate was encountered. So here is a small bit of script which highlights the problem I'm having:
Scriptname BScript02 extends Perk Event OnInit()Debug.Notification("OnInit")Utility.Wait(10.0)BMain()endEvent Function BMain()Debug.Notification("BMain")Utility.Wait(10.0)RegisterForSingleUpdate(1.0)EndFunction Event OnUpdate()Debug.Notification("OnUpdate")Utility.Wait(10.0)Debug.Notification("First wait over.")Utility.Wait(10.0)RegisterForSingleUpdate(0.5)endEvent
(That's the whole script.) Now, from where I'm standing, the above code should give the following result:
"OnInit", (10 seconds), "BMain", (10 seconds), "OnUpdate", (10 seconds), "First wait over.", (10.5 seconds), "OnUpdate" ... (loop)
What I instead get is the following (times are approximated):
"OnInit", (10 seconds), "BMain", (10 seconds), "OnUpdate", (5 seconds), OnUpdate (5 seconds), "First wait over.", "OnUpdate" (5 seconds), "First wait over.", "OnUpdate" ...
My interpretation (interpretation - not explanation) of this result is that the RegisterForSingleUpdate in the OnUpdate Event is being called at will, ignoring the 20 second delay purposefully put in there, causing a cascade of multiple, simultaneous instances of the OnUpdate Event. How this happens, and why it seems to happen at a particular interval (5 seconds??) are just further points of confusion.
Was I mistaken as to how the RegisterForSingleUpdate function is meant to work? Does the function have this ability to ignore the script at large and call itself willy nilly at difficult-to-control moments?