GetCurrentGameTime - Utility

From the CreationKit Wiki
Revision as of 01:44, 23 February 2018 by imported>Rasikko (Explanation on a fast travel bug.)
Jump to navigation Jump to search

Member of: Utility Script

Obtains the current game time in terms of game days passed (same as the global variable)

Syntax

float Function GetCurrentGameTime() native

Parameters

None.

Return Value

The current game time in terms of "game days passed".

Examples

; What is the current in-game time?
Debug.Trace("The current time is: " + Utility.GetCurrentGameTime() + " in game days passed")

Notes

  • There is a bug associated with fast traveling, that severely limits the use of this function as well as its globalvariable counterpart. When fast traveling over long distances, normally whole days are passed, and under normal circumstances, the day of the week and the date will update accordingly. However, there is a chance that they will not update properly. Instead, the day of week will not change with the date, resulting in the rest of the calendar year and calendar years after to be off by how many number of days were affected by this bug, resulting in dates falling on incorrect days of the week. For example, this bug has occurred for me when fast traveling from jetty boat(the one going to Harkon's castle) to Dawnguard. Instead of Frostfall 23 being Sundas, it was Loredas. The date changed accordingly, but the day of the week didn't. Thus, this function and the globalvariable will not count the day that was passed. There are 136 days left in 201 when the game starts. If this bug occur once, they will both report 135 days passed, instead of 136, and Morning Star 1 will begin on a different day of week, than the expected day for 4E 202.

Therefore.. this function can still be used to get a variety of units of time in Skyrim and be accurate so long as the bug doesn't occur but you can't know when that will happen.. and it's difficult check for 'missing' or 'skipped' days. This renders the function to being good for getting the fraction of a day.

See Also