Background for Starfield
Member of the ScriptObject script
eventOnPlayerSleepStart(floatafSleepStartTime, floatafDesiredSleepEndTime, ObjectReferenceakBed)

[DEV SERVER] Loading description...


Caveats

CK Wiki - Notes

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

Parameters

floatafSleepStartTime

CK Wiki Description

The time the player went to sleep, in game days passed.

floatafDesiredSleepEndTime

CK Wiki Description

The time the player wants to wake up at, in game days passed.

ObjectReferenceakBed

CK Wiki Description

The bed activated by the player.


Examples

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

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnPlayerSleepStart(float afSleepStartTime, float afDesiredSleepEndTime, ObjectReference akBed)
    Debug.trace("Event received - OnPlayerSleepStart: afSleepStartTime = " + afSleepStartTime + " afDesiredSleepEndTime = " + afDesiredSleepEndTime + " akBed = " + akBed)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.