Author Topic: Alright modders, rally up! What are we gonna do about callbackless daycycles?  (Read 1093 times)

What does mFloor do again

Doesn't it mess this up?
well theoretically it would take 5555 or 5.555 and turn it into 5000 or 5

We only want it to trigger at 0 and not at 0.333 right?

exactly.
that's why we call mfloor so we don't get 0.333.

exactly.
that's why we call mfloor so we don't get 0.333.
Um
what
But then
Uh
I'm tired what the forget

If you call mFloor it might trigger two times a noon
Or?

Your idea appears to return true every time getSimTime() equals a multiple of the time of day.

this is bad :(

what ho! this script will cause it to return WHAT SECOND OUT OF THE WHOLE DAYCYCLE LOOP IT IS

for example, if we're 15 seconds into a 60 second loop, it will return 15!

Code: [Select]
function getDayCycleTime()
{
%t = getSimTime();

%l = DayCycle.dayLength;

%t = %t / 1000;

%r = mFloor(%t % %l);

return %r;
}
« Last Edit: August 10, 2012, 08:13:25 PM by Lugnut »

Your idea appears to return true every time getSimTime() equals a multiple of the time of day.

this is bad :(

what ho! this script will cause it to return WHAT SECOND OUT OF THE WHOLE DAYCYCLE LOOP IT IS

for example, if we're 15 seconds into a 60 second loop, it will return 15!

Code: [Select]
function getDayCycleTime()
{
%t = getSimTime();

%l = DayCycle.dayLength;

%t = %t / 1000;

%r = mFloor(%t % %l);

return %r;
}
Yes, of course that will do that... And if it's 0 it should be midnight


0 is noon.
Idk
I can't see shaders idk what happens
I want home

Idk
I can't see shaders idk what happens
I want home
Doesn't matter. This is the day cycle, you can see the sun flare move accross the sky.

BTW, this is the only problem with the system, and it's actually a problem with the default daycycle. my math is sound.

... see attached image, once i add it.
« Last Edit: August 10, 2012, 08:21:30 PM by Lugnut »

Btw, this probabl won't work if the daycycle isn't started with the server by a gamemode or script, aka, later, and offset has to be put after %t=%t/1000 with a - operator

Btw, this probabl won't work if the daycycle isn't started with the server by a gamemode or script, aka, later, and offset has to be put after %t=%t/1000 with a - operator
No. The Daycycle's position through it's travels is directly locked to getSimTime().

PS, I'll be using your code for building an array when people add certain events to a brick for my onDay and onNight events.

No. The Daycycle's position through it's travels is directly locked to getSimTime().

PS, I'll be using your code for building an array when people add certain events to a brick for my onDay and onNight events.
I still think you have to care about the day cycle time offset
The slider under daycycle lap time

..... ggrrrrrrrrrrrrrrrrrrrr

okay this is no big deal. I simply have to do some addition/subtraction based on percentages. easy.
« Last Edit: August 10, 2012, 08:32:31 PM by Lugnut »

I wish I was awesome enough to be able to understand any of what you guys did.

You seem to have forgotten offset somewhere in there.