Difference between revisions of "GetCurrentGameTime - Utility"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rasikko
(Explanation on a fast travel bug.)
imported>Rasikko
m (→‎Notes: Use the global variable for faster processing.)
 
(2 intermediate revisions by the same user not shown)
Line 23: Line 23:


== Notes ==
== 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.  
* A bug occurs anytime you fast travel 4 hours or less before midnight and the distance is long enough that it takes over a day to get there. This results in the day of the week falling out of sync and the date being skipped(23 loredas becomes, 25 sundas instead of 24 sundas). In calendar terms, you're basically using a whole new calendar for the year, every time this bug occurs.
 
*It is much faster to use the GlobalVariable "GameDaysPassed" instead.
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 ==
== See Also ==

Latest revision as of 05:47, 7 March 2021

Member of: Utility Script

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

Syntax[edit | edit source]

float Function GetCurrentGameTime() native

Parameters[edit | edit source]

None.

Return Value[edit | edit source]

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

Examples[edit | edit source]

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

Notes[edit | edit source]

  • A bug occurs anytime you fast travel 4 hours or less before midnight and the distance is long enough that it takes over a day to get there. This results in the day of the week falling out of sync and the date being skipped(23 loredas becomes, 25 sundas instead of 24 sundas). In calendar terms, you're basically using a whole new calendar for the year, every time this bug occurs.
  • It is much faster to use the GlobalVariable "GameDaysPassed" instead.

See Also[edit | edit source]