Difference between revisions of "Dynamically Attaching Scripts"

Modified code slightly to check if the quest is completely stopped, with failover after 5 seconds. Should result in less waiting and more reliability.
imported>Sagitarius22
imported>Chesko
(Modified code slightly to check if the quest is completely stopped, with failover after 5 seconds. Should result in less waiting and more reliability.)
 
Line 365: Line 365:
Event OnUpdate()
Event OnUpdate()
DASQuest.Stop()
DASQuest.Stop()
         Utility.Wait(0.3);we must wait a bit before restarting the quest. It has been confirmed that using Stop() and Start() may not work.
 
         ;We must wait until the quest has stopped before restarting the quest. Using Stop() and immediately Start() may fail.
        ;Continue after 5 seconds to prevent infinite loop.
        int i = 0
        while !DASQuest.IsStopped() && i < 50
            Utility.Wait(0.1)
            i += 1
        endWhile
 
DASQuest.Start()
DASQuest.Start()
RegisterForSingleUpdate(5)
RegisterForSingleUpdate(5)
Anonymous user