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?
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?
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.
What about it?
daysPassed = GameDaysPassed.GetValueInt()days = GameDay.GetValueInt()daysPassed += 1days += 1GameDaysPassed.SetValue(daysPassed)GameDay.SetValue(days)GameHour.SetValue(6)
But what happens if you are on the last day of a month or a year? Those scenarios have to be accounted for.