Background for Skyrim SE
Member of the Actor script
intfunctionGetSleepState()Native

Description

Wiki Description

Gets this actor's sleep state.

Documentation Comment

Obtains this actor's sleep state, which is one of the following:
0 - Not sleeping
2 - Not sleeping, wants to sleep
3 - Sleeping
4 - Sleeping, wants to wake


Caveats

CK Wiki - Notes

  • GetSleeping also has a return value of 1 when the actor is loading the sleep idle. This return value is not documented for this function.
  • It is undocumented whether this function will work on the player. Exercise caution and update this page with the results of any tests. You may need to use IsPCSleeping instead.
    • This function will return 3 when the player is using a furniture marker that causes the player to play any of the IdleBed* Anim Events. If this is a furniture marker with a Sit marker, GetSitState() will return 2 (Not sitting, wants to sit) until the player completely lays down, at which point GetSitState() will return 0 and GetSleepState() will return 3.

Examples

; Is the actor sleeping?
if (Sleepy.GetSleepState() == 3)
  Debug.Trace("Sleepy is sleeping!")
endIf

Auto-Generated Example

int returnedValue = myActor__toCallFunctionOn.GetSleepState()

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.