Ingame Time

Post » Thu Jun 21, 2012 8:05 am

Hi,

is there a possibility to get the current ingame time? Or to get whether it is day or night.

I'm trying to build a house that changes in the night.


Thanks for every help.
User avatar
Mariaa EM.
 
Posts: 3347
Joined: Fri Aug 10, 2007 3:28 am

Post » Thu Jun 21, 2012 12:36 pm

There's an engine maintained Global, GameHour [GLOB:00000038], which you can check with http://www.creationkit.com/GetValue_-_GlobalVariable. It's military time, so anything > 6.0 and < 18.0 should be daylight'ish.

Event SomeEvent()	If IsDaylight()		; Daytime code	Else		; Nighttime code	EndIfEndEventBool Function IsDaylight(Float afTime = 0.0)	afTime = (Game.GetForm(0x00000038) As GlobalVariable).GetValue()	If afTime < 6.0 ; 6am		Return False	ElseIf afTime > 18.0 ; 6pm		Return False	Else		Return True	EndIfEndFunction
User avatar
Ian White
 
Posts: 3476
Joined: Thu Jul 19, 2007 8:08 pm

Post » Thu Jun 21, 2012 8:57 am

Thank you.
Thats exactly what I need.
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am


Return to V - Skyrim