zdswulyx Posted August 1, 2016 Share Posted August 1, 2016 Is there a way to compute the game time difference between two events?Imagine a quest where you have to go to a place and come back, and you want to show a message like: You needed 3 days, 4 hours, 43 minutes! Now, I saw the global variables GameYear, GameMonth, GameDay, and GameHour. But it seems quite clunky to manually use them, there isn't a simpler way? Link to comment Share on other sites More sharing options...
QQuix Posted August 1, 2016 Share Posted August 1, 2016 float MyTimeStamplet MyTimeStamp := ( GameDaysPassed * 24 ) + GameHour Every time you calculate as above, you get the number of hours since the game started (Integer part is hours, the non-integer part is fraction of one hour that can be converted to minutes and seconds) Comparing two timestamps gives you the elapsed time, in hours. You may save the timestamp of a kick-off event and, as time passes, calculate how long lince that event occurred. You may also, for example, set a time limit of 3 days/72 hours by using (GameDaysPassed +3) in the formula and, as time goes by, calculate how much time is left before the timer expires. Link to comment Share on other sites More sharing options...
TheMastersSon Posted August 1, 2016 Share Posted August 1, 2016 Careful with the GameDaysPassed variable, it's a short in Oblivion/Skyrim and a float in FO3 and later. As far as I know. Link to comment Share on other sites More sharing options...
zdswulyx Posted August 2, 2016 Author Share Posted August 2, 2016 I have to admit, a float what I was expecting in the first place. It's quite strange that GameDaysPassed keeps track only of the days. Anyhow, the ( GameDaysPassed * 24 ) + GameHour should work fine. THANKS! Link to comment Share on other sites More sharing options...
QQuix Posted August 2, 2016 Share Posted August 2, 2016 That is the formula the game engine uses for Cell Reset. Link to comment Share on other sites More sharing options...
Recommended Posts