How do I advance 1 game day?

Post » Wed Mar 18, 2015 10:21 pm

Wiki is offline now so can't consult that. I want that when the player awakes from being knocked out that 1 game day has passed. Erm... that's it, thanks.

User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Thu Mar 19, 2015 11:49 am

Have to run off to work so I apologize but I only have time to be incredibly vague: I do something like this with boat travel for Falskaar, though I make it obvious to the player. (You could easily completely hide it)

TL:DR - Save the player's current gamespeed, then set it to really fast until you detect that 1 day has passed.

The game's speed is saved in the global "TimeScale". You can GetValue on that, and set it to a variable to save it. Once saving it's current value as a variable, you can use SetValue to make it something crazy, like 20000. Then use "Utility.WaitGameTime(24)" to wait 24 hours, then set it back to the saved speed. You will also want to disableplayercontrols() during this period of course so players don't screw things up. Mix this with moving the player, ISMs, etc.

The end result is that the controls are locked, time zips passed, then scale is reset and the player is none the wiser.

User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Thu Mar 19, 2015 5:33 am

Just to add to Mr Velicky's solution, you don't want this speeded up clock during the normal part of the game. All kinds of weird things happen. So, run it as long as you need to advance the time, then make sure the clock is then back to normal. It won't hurt anything if your sleeping or waiting while the clock is sped up, just doing stuff in the game.

User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm


Return to V - Skyrim