Skijarama Posted June 28, 2017 Share Posted June 28, 2017 Hello! I am currently poking at making a mod that adds a new quest to Skyrim. I'll be moving it over to the Special Edition when I finish it, but due to the voice over issue in the special editiion creation kit, I am making it in base game for now. All that aside, a notable thing I want to have happen with the quest is that, when the player sleeps in a very specific bed (rented from a new NPC like an inn room), he will wake up with having taken damage to his HP equal to, say, 10 to 15% of his/her max HP. This is meant to indicate that something happened while the player was asleep in their location, but he/she does not remember it happening. If there is also a way of just messing up the surrounding room by flinging physics objects and clutter like plates and food and stuff all over the place, it would help make the scenario I am trying to put together more believable, but the mess is optional for now. That said, it has been a long time since I messed with creation kit modding, so I'm kinda drawing blanks as to how to get this particular thing to happen. Any help? Thanks in advance. :) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 28, 2017 Share Posted June 28, 2017 I have never used it and thus not sure if it will work for your needs. There is an event called OnSleepStop. You should be able to use that to trigger your HP damage effect when the player wakes up. Something like the following which should be applied to the bed (or a quest alias which the bed is assigned): Event OnActivate(ObjectReference akActivator) If akActivator == Game.GetPlayer() RegisterForSleep() EndIf EndEvent Event OnSleepStop(Bool abInterrupted) If abInterrupted == false ;do actions for a full sleep period Else ;do actions for an interrupted sleep period EndIf EndEventAs far as messing up the place, you could pre-place objects that are initially disabled and have them enabled with the OnSleepStart event. REMINDER: The above is theory only. I have never used those functions/events and do not know how they actually behave in game. Link to comment Share on other sites More sharing options...
Skijarama Posted June 28, 2017 Author Share Posted June 28, 2017 (edited) I have never used it and thus not sure if it will work for your needs. There is an event called OnSleepStop. You should be able to use that to trigger your HP damage effect when the player wakes up. Something like the following which should be applied to the bed (or a quest alias which the bed is assigned): Event OnActivate(ObjectReference akActivator) If akActivator == Game.GetPlayer() RegisterForSleep() EndIf EndEvent Event OnSleepStop(Bool abInterrupted) If abInterrupted == false ;do actions for a full sleep period Else ;do actions for an interrupted sleep period EndIf EndEventAs far as messing up the place, you could pre-place objects that are initially disabled and have them enabled with the OnSleepStart event. REMINDER: The above is theory only. I have never used those functions/events and do not know how they actually behave in game.Okay, I'll give it a whirl and make an edit or new post on this thread when I know for sure if it works. EDIT: The quest advanced nicely. The bloodstain did not appear, but I can figure that out later. For now, getting the NPC to do his forcegreet is more important. Thanks for the assist though! Edited June 28, 2017 by Skijarama Link to comment Share on other sites More sharing options...
Recommended Posts