Game Hour and Game Days Passed

Post » Sat Dec 21, 2013 7:45 pm

Hi there.

So i have a little problem)

I use the global variable "GameHour" in my script:

GameHour.SetValue(6)

If game hour now is 13 P.M. i need to global variable "GameDaysPassed" increased by one. Who knows?

User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Sat Dec 21, 2013 1:26 pm

Is this for simulating the passage of time? If so, then I can think of two solutions:

- a fairly complex function that can correctly set the values of various global variables (GameHour, GameDay, GameMonth, GameYear) while accounting for varying numbers of days in a month.

- temporarily alter the Timescale global variable and let the game engine take care of setting the time and date.

User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Sat Dec 21, 2013 9:06 pm

What about it?

daysPassed = GameDaysPassed.GetValueInt()days = GameDay.GetValueInt()daysPassed += 1days += 1GameDaysPassed.SetValue(daysPassed)GameDay.SetValue(days)GameHour.SetValue(6)
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Sat Dec 21, 2013 11:08 am

But what happens if you are on the last day of a month or a year? Those scenarios have to be accounted for.

User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm


Return to V - Skyrim