Jump to content

OnUpdate Event Not Working!


xcafe

Recommended Posts

Title says it all, I have a RegisterForSingleUpdateGameTime function set for 24.0 (24 skyrim hours) and an OnUpdateGameTime event, but the event is never being called.

 

 

 

State Studied

Event OnBeginState()
NotStudied = false
Debug.Notification("State 'Studied' Entered")
RegisterForSingleUpdateGameTime(24.0)
Debug.Notification("Registered for update(24)")
EndEvent


Event OnUpdateGameTime()
Debug.Notification("OnUpdateGameTime(24) Called")
Int ListSize = CentralQuest.GSL.GetSize()
Int Index = 0
While Index < ListSize
Form Entry = CentralQuest.GSL.GetAt(Index)
If (Entry as Spell)
PlayerRef.RemoveSpell(Entry as Spell)
EndIf
Index += 1
EndWhile

GoToState("")
EndEvent

EndState

 

 

 

P.S. The debugs after the Register function are going off, but not the one in the Update event.

Link to comment
Share on other sites

If your script (or another script on the same object) should register for another update before the update event is called for the first registration, the new registration will take priority and the old ditched. So make sure that you don't allow multiple registrations to be called.

 

It may also be that when the update event is called to be triggered the script is no longer in the particular state in question. You may want to try putting the update event in the empty state just to see if that makes a difference.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...