Jump to content

Script Problems!


xcafe

Recommended Posts

So I've isolated the problem! Not sure how to fix it, or what's causing it, but at least I know what's actually happening now.

 

 

 

State Studying

Event OnBeginState()

;This will run as studying begins.
;;; Include anything that needs to happen at study start here.
bStudying = True
Game.DisablePlayerControls(True, True, True, False, True, True, True, True)
Game.ForceThirdPerson()
RegisterForSingleUpdateGameTime(0.05) ; sets when studying will be complete
WHILE (bStudying) && (playerref.GetSitState() == 3)
playerref.PlayIdle(IdleChairRead)
Utility.Wait(10.0)
playerref.PlayIdle(IdleChairPageTurn)


EndWhile

EndEvent




Event OnUpdateGameTime()
{Called when the required study time is completed.}
;;; Include anything that needs to happen at study completion here.
Debug.Notification("OnUpdateGameTime Called")
UnregisterForUpdate()
Debug.Notification("Unregistered For update")

bStudying = False
Debug.Notification("bStudying = False")

Int ListSize = CentralQuest.GSL.GetSize()
Int Index = 0
While Index < ListSize
Form Entry = CentralQuest.GSL.GetAt(Index)
If (Entry as Spell)
PlayerRef.AddSpell(Entry as Spell)


EndIf
EndWhile
Index += 1
Game.EnablePlayerControls()
GoToState("Studied") ; leave studying state so OnRead can trigger again

EndEvent

EndState  

 

 

 

That OnUpdateGameTime event is just never happening! I don't know how to fix this, do any of you?

Link to comment

How you trigger for the first time the status "Studying"?

What is the object that has this script attached to it?

 

And you are doing an active loop.

It is difficult to stop it by asking for an event.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use