Guest Posted January 2, 2020 Posted January 2, 2020 SexLab - Freeze Game Time View File Introduction:  Playing as a vampire with sun damage turned on made me realize how much time I would spend in a SexLab animation just adjusting the alignment. This mod freezes the game time until the animation is over. You no longer have to worry about the game time while in an animation. You can toggle it on/off from the MCM before an animation begins.  Installation:  Just drop everything into the Data folder or use a mod manager to install it. Load order doesn't matter.  Uninstallation:  Open the console and type "stopquest SLFreezeGameTimeConfigQuest" without the quotes. Save your game. Remove the mod's files from the Data folder or use your mod manager to uninstall it.  Known Issues:  There is no proper way to do something like this with Papyrus (at least not that I could find). This mod is simply a hack that sets the GameHour Global Variable to our frozen time every 5 seconds. Freezing the game day is not as simple. While the actual day can be set at the Global Variable GameDay, the week day cannot be set from Papyrus. To prevent the issue of setting the game time of the next day, the time will not be frozen between 23:55 and 00:05, allowing the game to switch days and then finally freezing it once the time is equal or greater than 00:05. Maybe eventually I'll replace this with a SKSE plugin detouring the subroutine that increases GameHour, but until then, this cannot be reliably fixed.  NOTE: The above issue does not apply for Time Scale mode. Submitter Hawk9969 Submitted 01/02/2020 Category Framework & Resources Requires Sex Animation Framework v1.62 or higher Special Edition Compatible Yes
mrsrt Posted January 2, 2020 Posted January 2, 2020 1 hour ago, Hawk9969 said: There is no proper way to do something like this with Papyrus (at least not that I could find). This mod is simply a hack that sets the GameHour Global Variable to our frozen time every 5 seconds. You can use timescale var. "set timescale to 0" console command will freeze ingame clocks, return it back to 20 (default) when you want normal counting. CK variable is gfTimeScale if I remember correctly.Â
Guest Posted January 2, 2020 Posted January 2, 2020 34 minutes ago, mrsrt said: You can use timescale var. "set timescale to 0" console command will freeze ingame clocks, return it back to 20 (default) when you want normal counting. CK variable is gfTimeScale if I remember correctly. Changing the time scale was my initial idea, until I'd started searching about it and came across several messages like the one below. Quote It should be noted that setting timescale to either 1 or 0 has been known to cause issues. So I continued searching for a way to implement this without having to set up a SKSE project for something this simple and came across this.  I do not know if the issues with timescale 0 are shared with always forcing the GameHour Global Variable, but I really don't have the time to debug this; It could show up right away or take hours to show up. Since I do not know exactly what issues those are, I also can't determine their impacts without some good amount of played timed. Whether those issues exist if we are just setting the timescale to 0 for SexLab animations only or not, I do not know.  Overall this approach has been safe so far for me, by running only every 5s and only when the player is in an animation, there is pretty much no performance impact. OnUpdateGameTime wouldn't fire as I'd expected (was trying setting it up for every 5 and 10 in-game minutes), so I had to rely on blind OnUpdate events. There is the issue with the new day, but it should be ok for most people to lose only 10 minutes of game time if they start an animation between 23:55 and 00:05.
Lilzt3hcat Posted January 2, 2020 Posted January 2, 2020 I'm glad this doesn't mess with timescale as I use a custom one since I find 20 to be way to fast and 10 seems to work without issues with quests while feeling less 'crazy'. I'll def give the mod a try see if I like it. Though if it ever does come to that it would be neat to see something where you can control what you get so you could keep your 'default' while having time stop or also just be slower (or even faster perhaps if you wanted to for some reason) while animations are going on.
mrsrt Posted January 2, 2020 Posted January 2, 2020 3 hours ago, Hawk9969 said: ince I do not know exactly what issues those are, I also can't determine their impacts without some good amount of played timed. You may break quests/events/scripts that are have usages of Utility.GetCurrentGameTime(), but with your solution it will break it anyway, so, probably, there's no point to keep a runner for that. The problem is in the entire idea, you want to stop time, then events, based on game time will suffer. Just keep the timescale value before editing and bring it back when finish (in case someone has it custom).  3 hours ago, Hawk9969 said: There is the issue with the new day, but it should be ok for most people to lose only 10 minutes of game time if they start an animation between 23:55 and 00:05. A problem may happen if a player has high timescale, but it's not a common situation. Another problem may happen if script engine is busy and execution delayed.
decaluka Posted January 2, 2020 Posted January 2, 2020 I'll be honest, your mods and Monoman's tweaks are the two main reasons I'm not switching to SE anytime soon
Guest Posted January 2, 2020 Posted January 2, 2020 6 hours ago, mrsrt said: You may break quests/events/scripts that are have usages of Utility.GetCurrentGameTime(), but with your solution it will break it anyway, so, probably, there's no point to keep a runner for that. I do not believe they are equivalents. RegisterForUpdateGameTime(0.0833) called my event every +5 minutes, even if I had set the game time back to its frozen value. Example, if the animation started at 7:00 pm, the first update would occur at around 7:05, it would then set it back to 7:00 but the next update would occur only at 7:10, then 7:15, then 7:20 and so on. The event handler likely sets a timestamp for when it should send the next update. I'll have to test it out with RegisterForSingleUpdateGameTime and see how it behaves. I am pretty sure by just setting the timescale to 0 it would receive no updates at all.  Another problem with setting the TimeScale Global Variable instead of GameHour, is that other mods mess with it (Requiem for example). If the TimeScale variable is reset during a SexLab animation, I would need to keep updates running anyway to change its value back to 0; No way to detect via Papyrus only that a mod changed it without checking it ourselves. 6 hours ago, mrsrt said: The problem is in the entire idea, you want to stop time, then events, based on game time will suffer. Yes, this is why I'd mentioned there is no proper way to do this with Papyrus alone. Messing with both the GameHour and TimeScale Global Variables have their share of issues. Unfortunately, patching the addresses that write to GameHour will likely be no different. It will require a lot more work. And I don't see another workaround if I want to keep the strengths and weaknesses of my vampire (or any game time based buff for that matter). Adjusting animation alignments is such a huge time waster and a pain in the ass. 6 hours ago, mrsrt said: A problem may happen if a player has high timescale, but it's not a common situation. Another problem may happen if script engine is busy and execution delayed. Yes, which is why I chose 23:55 to 00:05. This should be enough for a timescale up to 30 and some delay. Unfortunately, a high Papyrus delay will break many things, including this (setting the hour for the next day).  For supporting higher timescales, I've two choices: Calculate update time from current timescale. See if I can get RegisterForSingleUpdateGameTime to work the way I want it to.  Overall, if you plan to use this mod, make sure to keep a save you can go back to and please report any odd behavior(s) that may be caused by this mod.  EDIT: RegisterForSingleUpdateGameTime behaves exactly the same as RegisterForUpdateGameTime.
mrsrt Posted January 2, 2020 Posted January 2, 2020 5 hours ago, Hawk9969 said: I do not believe they are equivalents. If a script works directly with GameHour and writes it to own variables for future processing it may bring unhappy side effects. I remember some werewolf mod with moon phases has a script like that. 4 hours ago, Hawk9969 said: I am pretty sure by just setting the timescale to 0 it would receive no updates at all. Papyrus engine has an opportunity to also get the real system time with Utility.GetCurrentRealTime(). Sexlab works exactly with real time, so, neither timescale nor your way will affect on it. Sexlab also sends events when animation starts and ends, so, you can also freely change timescale with them. Actually, this is everything you need to do for timescale solution. 5 hours ago, Hawk9969 said: Another problem with setting the TimeScale Global Variable instead of GameHour, is that other mods mess with it (Requiem for example). Personally, I don't use Requiem, so, I cannot affirm anything, but, I bet, if you return the exact value that you took before animation start it shouldn't damage any mechanic.  Btw, thanks for the mod.Â
Guest Posted January 3, 2020 Posted January 3, 2020 8 hours ago, mrsrt said: Papyrus engine has an opportunity to also get the real system time with Utility.GetCurrentRealTime(). Sexlab works exactly with real time, so, neither timescale nor your way will affect on it. Sexlab also sends events when animation starts and ends, so, you can also freely change timescale with them. Actually, this is everything you need to do for timescale solution. The problem is not pausing SexLab itself, but the game time while we are in a SexLab animation. Real time doesn't matter much in this case, I just don't want to start an animation at midnight and leave it at 6 am because I've had spent way too much time aligning some animations (OCD, bro). And yes, I already use the events to determine when I should freeze the game time. 8 hours ago, mrsrt said: Personally, I don't use Requiem, so, I cannot affirm anything, but, I bet, if you return the exact value that you took before animation start it shouldn't damage any mechanic. The problem is another mod setting a new timescale while we've already set it to 0 when starting the animation; This will unfreeze the game time. With the new version, I've an update set for every 10s as to enforce that it stays at 0 within SexLab animations.  As for everyone else, I've released a new version that should make Game Hour compatible with higher time scales (> 30) and the ability for you to choose whether you want it to reset the GameHour variable or just set the timescale to 0. You can change which mode to use from its MCM. Again, please let me know of any odd behavior. I haven't tested the Time Scale mode other than checking whether it works or not, but I've been using the Game Hour mode and so far haven't run into any issues.  If you've the old version baked into your save file, you will need to disable it first before updating. Load your game and open the console. Type: stopquest SLFreezeGameTimeConfigQuest Save your game. Disable SexLab - Freeze Game Time.esp from your load order. Load your previously saved game. Save again. (Optional) Run ReSaver on the final save as to clean up any leftovers. Update this mod. Re-enable SexLab - Freeze Game Time.esp within your load order.
Lilzt3hcat Posted January 3, 2020 Posted January 3, 2020 Just thought of potentially an issue with timescale. Does the arousal system rely on that for how much arousal to add or not? If so when timescale is 0 might have the issue of no one can 'get off' lol.
Guest Posted January 3, 2020 Posted January 3, 2020 13 minutes ago, Lilzt3hcat said: Just thought of potentially an issue with timescale. Does the arousal system rely on that for how much arousal to add or not? If so when timescale is 0 might have the issue of no one can 'get off' lol. I checked and only the time calculation for exposure rellies on game time. If you are just concerned about the animation actors, then SLA will run its orgasm code at the end of the animation for each actor (assuming you are not running SLSO). If you are in an animation and wants to affect the non-animation NPCs around you, you will have to disable this mod in the MCM before starting the animation.
Lilzt3hcat Posted January 3, 2020 Posted January 3, 2020 1 hour ago, Hawk9969 said: I checked and only the time calculation for exposure rellies on game time. If you are just concerned about the animation actors, then SLA will run its orgasm code at the end of the animation for each actor (assuming you are not running SLSO). If you are in an animation and wants to affect the non-animation NPCs around you, you will have to disable this mod in the MCM before starting the animation. I do use SLSO, which on testing seems to work fine with this mod ?
Guest Posted January 15, 2020 Posted January 15, 2020 So... anyone got any problems with either resetting GameHour or setting TimeScale to 0? I haven't had the time to do much gaming, but I also haven't seen much activity in here either and as such, I am assuming its behavior is satisfactory.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now