Function for Time of Day

From the CreationKit Wiki
Revision as of 18:27, 20 February 2012 by imported>Cipscis (moved Script for Time of Day to Function for Time of Day: This page describes a custom function, not a script)
Jump to navigation Jump to search


The global function GetCurrentGameTime can be used to return the number of in-game days passed, including the fraction of the current day that has passed.

This function removes the portion of GetCurrentGameTime's return value that returns to previous in-game days, then converts the remaining portion to hours.


float Function GetCurrentHourOfDay() 

	float Time = Utility.GetCurrentGameTime()
	Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit
	Time *= 24 ; Convert from fraction of a day to number of hours
	Return Time

EndFunction