Difference between revisions of "Function for Time of Day"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Daemonjax
(Created page with "returns: 0 <= return_value < 24 i.e. Midnight is 0, noon is 12, and 5:30 PM is 17.5 ---- Float FUNCTION getCurrentHourOfDay() float temp = Utility.GetCurrentGameTime() *...")
 
imported>Tiara
m
Line 3: Line 3:


----
----
 
<source lang="papyrus">
Float FUNCTION getCurrentHourOfDay()  
Float FUNCTION getCurrentHourOfDay()  


Line 11: Line 11:


ENDFUNCTION
ENDFUNCTION
</source>

Revision as of 02:38, 19 February 2012

returns: 0 <= return_value < 24 i.e. Midnight is 0, noon is 12, and 5:30 PM is 17.5


Float FUNCTION getCurrentHourOfDay() 

float temp = Utility.GetCurrentGameTime() * 24 

return ((temp as int) % 24) + (temp - (temp as int)) 

ENDFUNCTION