Author Topic: DayCycle Questions and Event Question  (Read 1579 times)

Daycycle Question
How do I get the current daycycle offset, like the time of day? (Daycycle.offset only gets what it was originally set to)
(I think I can figure this out if I can find a variable somewhere that determines what time (getSimTime() time-wise) the daycycle began)

Is there any function I can package that loops with the dayCycle (like a tick function so that I can sync some things such as changing the fog distance and sun flare size as .daycycle files do not include these)?

Event question
I have set all the variables on a brick to define an event (eg %brick.eventOutputDelay0, %brick.eventOutputIdx0, etc... for all events)
It seems the events aren't getting applied. How do I apply them?
« Last Edit: August 07, 2013, 08:05:42 PM by DYLANzzz »

I released a mod called Event_DayCycles.
It doesn't work properly with day lengths that are not divisible by four, but you can look it over and get the general idea of how daycycles work.

I released a mod called Event_DayCycles.
It doesn't work properly with day lengths that are not divisible by four, but you can look it over and get the general idea of how daycycles work.
Hahaha, I have already been doing that :P
So, for:
Code: [Select]
%final = mFloor(%curTime % %length);Aren't you assuming that the the day starts when %curTime (which is $Sim::Time or getSimTime()) is 0? Is that not necessarily true? Like if I just tick the Enable Day/Night Cycle box at some random time through the mission?
« Last Edit: August 07, 2013, 09:07:52 PM by DYLANzzz »

Aren't you assuming that the the day starts when %curTime (which is $Sim::Time or getSimTime()) is 0? Is that not necessarily true? Like if I just tick the Enable Day/Night Cycle box at some random time through the mission?
Ah, never mind, I see what you were saying when you meant it was synced with getSimTime(); But it's still acting really weird.
It seems as though the sun moves oddly through the sky. Like if the dayLength is 100, it takes it approxiametly 60 to move one half of the sky (during the day), and 40 for the other half (for the night).

I think there's something going on with this, where it speeds up between 0.6 and 0.9. http://forum.blockland.us/index.php?topic=204914.0#post_daycycle
(looking at the sun, it seems that this is only approximately right)

Event question
I have set all the variables on a brick to define an event (eg %brick.eventOutputDelay0, %brick.eventOutputIdx0, etc... for all events)
It seems the events aren't getting applied. How do I apply them?
Here is an example of adding onActivate > Self > door > OpenCW. %obj is the brick.
Code: [Select]
%obj.eventDelay0 = 0;
%obj.eventEnabled0 = 1;
%obj.eventInput0 = "onActivate";
%obj.eventInputIdx0 = inputEvent_GetInputEventIdx("onActivate");
%obj.eventOutput0 = "door";
%obj.eventOutputAppendClient0 = 1;
%obj.eventOutputIdx0 = outputEvent_GetOutputEventIdx("fxDTSBrick", "door");
%obj.eventOutputParameter0_1 = 2;
%obj.eventTarget0 = "Self";
%obj.eventTargetIdx0 = 0;
%obj.numEvents = 1;

Or you can use an easier alternate method HERE.

Or you can use an easier alternate method HERE.

This is the correct method, I believe.

This is the correct method, I believe.
There is no "correct" method. It's just preference. Rotondo used the first method I mentioned in Support_Doors.

Although on second thought, I suppose it would be better to use the second method, for the sole reason of there being a function called.
« Last Edit: August 08, 2013, 08:00:11 AM by jes00 »

Ah, never mind, I see what you were saying when you meant it was synced with getSimTime(); But it's still acting really weird.
It seems as though the sun moves oddly through the sky. Like if the dayLength is 100, it takes it approxiametly 60 to move one half of the sky (during the day), and 40 for the other half (for the night).

I think there's something going on with this, where it speeds up between 0.6 and 0.9. http://forum.blockland.us/index.php?topic=204914.0#post_daycycle
(looking at the sun, it seems that this is only approximately right)
my system relies on dividing the day up into four parts. Imagine you have 24 hours in a day. My system is like saying that dusk starts at 6 pm. Period. Regardless of where the sun is in the sky, like different times of the year, days are longer in summer, but it's still six oh clock. It has no methods for reading the file of the day cycle theme thing. It's totally possible though. Not a half bad idea.
« Last Edit: August 08, 2013, 07:51:49 PM by Lugnut »

Hahaha, I have already been doing that :P
So, for:
Code: [Select]
%final = mFloor(%curTime % %length);Aren't you assuming that the the day starts when %curTime (which is $Sim::Time or getSimTime()) is 0? Is that not necessarily true? Like if I just tick the Enable Day/Night Cycle box at some random time through the mission?
it's true. I tested this extensively, change the day length and note how the sun jumps instead of just speeding up.