need help with OnSleepStart

Post » Tue Jun 19, 2012 1:24 am

I can't get OnSleepStart to trigger... and also can two separate events both modify the variable "z" like that?
thanks for any help.

this is attached to a Quest , start enabled


Scriptname sleepScript extends Questimport Debugbool hasSleptint zEvent OnInit()   RegisterForUpdate(5)   Debug.MessageBox("Script Init!") EndEvent  Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)   hasSlept = true   z = 0   Debug.MessageBox("Sleep Started")EndEventEvent OnUpdate()    if hasSlept == true	    Debug.MessageBox("OnUpdate says we slept")         hasSlept = False    else         Debug.Notification("still awake")    endif	 z += 1	  Debug.Notification("z = " + z)endEvent
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Tue Jun 19, 2012 6:13 am

please some knowledgable person help. How do i make it work?
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Tue Jun 19, 2012 5:18 am

So long as your variable is defined outside of the events, it's not local to your events, so that much is fine. In order for the http://www.creationkit.com/OnSleepStart_-_Form event to be called, though, you need to call http://www.creationkit.com/RegisterForSleep_-_Form.

Cipscis
User avatar
Antonio Gigliotta
 
Posts: 3439
Joined: Fri Jul 06, 2007 1:39 pm

Post » Mon Jun 18, 2012 6:02 pm

I had utterly forgotten about that. Thank you. My day is better now.
User avatar
N3T4
 
Posts: 3428
Joined: Wed Aug 08, 2007 8:36 pm


Return to V - Skyrim