Author Topic: Help With Daycycle  (Read 9260 times)

Okay, what I'm trying to do is create something that announces what hour it is in game every 5 minutes, so in the game I made the hour last 5 minutes. Therefore, 5 Mins = 1 Hour In Game, and I'm trying to set the daycycle to sync up with that but I'm not sure how to do it. If anyone knows anything about syncing the daycycle to position the sun to be in a certain spot in the sky during every time a 5-minute long hour passes, that would be greatly appreciated!

I would suggest taking a look at the daycycle event addon to see how it's done. I made a clock that stayed synced up with the cycle, the daycycle event addon helped a lot


60 / 5 = 12x time compression
86400 / 12 = 7200 seconds

There, set your day length to that.
Also this belongs in Help.

I'm sorry, I guess I was really vague with everything. I'm trying to get the daycycle to sync up with a time mod that I have in the server, and was wondering if theres any coding side to it that would be able to help me. Like, what daytime offset would be 1-11AM in the daycycle?

If X is the length of the daycycle in seconds, and Y is the number of seconds in you want to set the daycycle to:

%current = $Sim::Time / X;
DayCycle.setDayOffset(Y - (%current - mFloor(%current)));

yeah while my daycycle event add-on was the first to do that, it was riddled with bugs that i never could reproduce
look at ports daycycle resource, it probably works properly

If X is the length of the daycycle in seconds, and Y is the number of seconds in you want to set the daycycle to:

%current = $Sim::Time / X;
DayCycle.setDayOffset(Y - (%current - mFloor(%current)));


As in, Y would be the number of seconds 11 hours would be in my game time?

yeah while my daycycle event add-on was the first to do that, it was riddled with bugs that i never could reproduce
look at ports daycycle resource, it probably works properly

Thanks guys I'll take a look and post what happens.
« Last Edit: May 18, 2014, 12:36:03 PM by Gordo12699 »