OnPlayerSleepStart - ScriptObject

From Creation Kit
Jump to: navigation, search

Member of: ScriptObject

Event called when the player goes to sleep - if this active magic effect/alias/form is registered for it.

This event will only be sent to the specific script that registered for it. Other scripts attached to the same form/alias/active magic effect will not receive the event unless they also register.

Syntax

Event OnPlayerSleepStart(float afSleepStartTime, float afDesiredSleepEndTime, ObjectReference akBed)

Parameters

  • afSleepStartTime: The time the player went to sleep, in game days passed.
  • afDesiredSleepEndTime: The time the player wants to wake up at, in game days passed.
  • akBed: The bed activated by the player.

Example

Function SomeFunction()
  RegisterForPlayerSleep() ; Before we can use OnSleepStart we must register.
EndFunction
 
Event OnPlayerSleepStart(float afSleepStartTime, float afDesiredSleepEndTime, ObjectReference akBed)
	Debug.Trace("Player went to sleep at: " + Utility.GameTimeToString(afSleepStartTime))
	Debug.Trace("Player wants to wake up at: " + Utility.GameTimeToString(afDesiredSleepEndTime))
        Debug.Trace("Player activated bed: " + akBed)
endEvent

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See Also