CreationKit shows the following for sleep:
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
So we can RegisterForSleep which will trigger this. But I want to interrupt the player randomly at some hour after game time has passed so I'm thinking
float interupttime = Utility.RandomFloat(0,afDesiredSleepEndTime)RegisterForUpdateGameTime(interupttime)
My hope was that this would trigger since gametime does pass when you're sleeping but then the note on the wiki says:
OnUpdateGameTime may come in much later then you expect if the player is sleeping, waiting, fast traveling, or serving jail time. The event will only be sent once, after the sleep/wait/travel/serve period is over, so you should be prepared to handle hours passing between updates.
But what is funny to me is that the wiki mentions the following about OnSleepStop:
Event OnSleepStop(bool abInterrupted)
Parameters
Parameters
- abInterrupted: Whether sleep was interrupted or not.
So how does a player get interrupted in their sleep otherwise?
Any suggestions? Basically this is for one of a few radiant quests that I have where certain conditions trigger certain bounty hunter attacks. I don't want to interrupt the player BEFORE they sleep, nor AFTER they wakeup to trigger. I want it to happen some time WHILE they are sleeping so that the benefits of sleeping in my mod get nullified. Granted, I guess if I just place an actor and have them attack during the OnSleepStart that would trigger an interruption but then time really hasn't passed and so it just becomes a nuance rather than a nusance.

Thanks!
-MM
Edit: Only a few scripts use OnSleepStop event, and only one of those uses abInterruptedValue. Only one script (outside of base class scripts) uses OnSleepStart and that's the Dark Brotherhod quest where player wakes in shack. It doesn't do anything unique.