Day - Night Loops

by RVMECH

 

Would you like to have your maps change from day to night while the game is being played? Well now you can with these easy to follow instructions. RVMECH, in-house map maker for RADEN, has developed a way to get day-night transitions in your map using only 5 triggers. 

Day-Night Loops Instructions:

First, set your ambient lighting to the lowest setting for your loop. In other words how dark do you want it. For this example we will use .35 as the ambient level. This may be too dark for some folks, as all monitors are not equal. I normally increase the "glow level" of the units, infantry, and aircraft to .4 by editing that section in the rules ini file. You can find this in the {AudioVisual} section. You can also cause the structures themselves to emit light by adding in the "lamp" parameters to each and every Buildable structure in the game. Yes, this is tedious but, I have a script that I use and it can be made available if enough folks would like it. 

Trigger #1: This trigger will start the Loop operating by initiating the process. Create a trigger and name it "Start Loop"(or anything that you like). House set to "Neutral" (civilian),with a non-repeating tag. Event #13 is normally used
which is time delayed. I use the parameter of 20 -70 seconds depending on the action parameters (the amount of time for the cycle to reset). There is only one action, #53 enable trigger...the parameter will be the next trigger, "Sunrise".

Trigger #2: This trigger will set the ambient level for the Maximum level we would like the loop to "float too. Create a new trigger. We will name this trigger "Sunrise", house set to "Neutral (civilian), with a repeating tag (2). This is important!! disable the trigger!!.. (all of the rest of the triggers will be disabled). Next we need to add an event. Select event #13, Elapsed Time, with a parameter of 32. This will cause the trigger to fire after 32 time tics from when it is enabled. Now we can add the actions to this trigger. We will be creating 5 actions for this trigger.

Action 0 will disable this trigger itself. We do this by selecting action # 54 and the parameter will be this trigger (Sunrise).

Action 1 will enable the next trigger in the loop, we will be calling this "Ambient is up". We do this by selecting action #53 enable trigger, this parameter will be blank for the moment, at least until we actually create "Ambient is up". 

Action 2, will be #73, Set ambient light, the parameter will be 95. This causes our ambient light level will rise from .35 to .95 at a rate and step value that we will set up in the next actions. 

Action 3, we will use #72, Set ambient rate, the parameter can be any float value from 1030000000 to 1070000000. It can be higher but this appears to be the optimum settings for the game in my opinion. For this example we will use 
the higher number,1070000000, as this causes the rate to smoothly rise at a non-annoying rate with 32 seconds in between steps, when used in conjunction with the next action we will be using...Remember the higher the number, the longer the time periods between steps. If it is a fast paced map you should lower it to get the "loop" effect to cycle completely in the game. 

Action 4, #71, Set ambient step, will set the step rate, or the time between each ambient step. Again the float value for this is a variable. After many experiments I have found that values between 1018000000 and 1025000000 seem to be the optimum values. We will be using 1019000000 because, as stated above , This works quite well when used in conjunction with the float
value for the previous action. Both actions interact with each other so you will need to experiment with the settings when making your own unique "Loop". Remember that the higher the number, the fewer the steps. Think of the process as a "stair step". The ambient RATE determines how high each step is, while the ambient STEP determines how many steps it takes to get to the top.
The interaction comes into play when you have too many or to few steps. If you have to many it will take you longer to get to the top and inversely , if you have to few then you will reach the top to fast!

Trigger #3: Causes one trigger to stop and reset and another to start. Create a trigger and name it "Ambient is up". House set to Neutral (civilian). Set the tag to repeating (2) and disable the trigger. Now before any thing else go back to the previous trigger (Trigger #2) and go to action 1 and select this new trigger (Ambient is up) as the parameter. Now go back to the current trigger.

The Event for this trigger will be #46, Ambient light >=, the parameter will be 95. This event will cause this trigger to "fire" when the ambient level is "equal to or greater than" .95

Action 0 will be #54, Disable Trigger, the parameter should be this trigger (Ambient is up)

Action 1, #53, Enable Trigger, the parameter will be left blank for the moment but will enable the next trigger in the loop after we create that.

Trigger #4: This trigger will set the ambient level for the Minimum level we would like the loop to "float" too. Create a new trigger. We will name this trigger "Sunset", house set to "Neutral (civilian), with a repeating tag (2). Now leave this trigger and go back to the previous trigger (Ambient is Up) and select action 1 and place the current trigger (Sunset) in the parameter box. Now go back to the current trigger. Select event #13, Elapsed Time, with a parameter of 32. This will cause the trigger to fire after 32 time tics from when it is enabled. Now we can add the actions to this trigger. We will be creating 5 actions for this trigger.

Action 0 will disable this trigger itself. We do this by selecting action # 54 and the parameter will be this trigger 
(Sunset).

Action 1 will enable the next trigger in the loop, we will be calling this "Ambient is down". We do this by selecting action #53 enable trigger,this parameter will be blank for the moment, at least until we actually create "Ambient is down". 

Action 2, will be #73, Set ambient light, the parameter will be 35. This causes our ambient light level will drop from .95 to .35 at a rate and step value that we will set up in the next actions. 

Action 3, we will use #72, Set ambient rate, again we will use the float value of 1070000000

Action 4, #71, Set ambient step, again we will use the float value of 1019000000 

Trigger #5: Causes one trigger to stop and reset and another to start. Create a trigger and name it "Ambient is Down". House set to Neutral (civilian). Set the tag to repeating (2) and disable the trigger. Now before any thing else go back to the previous trigger (Trigger #4) and go to action 1 and select this new trigger (Ambient is Down) as the parameter. Now go back to the current trigger.

The Event for this trigger will be #45, Ambient light <=, the parameter will be 35. This event will cause this trigger to "fire"
when the ambient level is "equal to or less than" .35

Action 0 will be #54, Disable Trigger, the parameter should be this trigger (Ambient is down)

Action 1, #53, Enable Trigger, the parameter will the trigger "sunrise". 

This should conclude the session of writing the Day\Night loop. If done correctly this is what should take place when the game starts. First off the #1 trigger will fire and 2 seconds later the #2 trigger will start. 32 seconds after starting, the ambient light level will begin to rise slowly, at approximately 32 seconds between each step, towards its goal of .95 ambient level. #3 trigger will fire and disable itself and enable the #4 trigger. #4 trigger will begin to move the ambient level back down to the minimum of .35, at the same rate as it used when raising it. Trigger #5 will again enable trigger #2, thus completing
the loop.

NOTE: You can also download a zip file containing all the information above plus a script RVMECH wrote for the day-night cycles. Click here for the download.

 

The tutorials on this section are copyright© RADEN - cncgames.com, and non of the tutorials on this section may be copied for use on other websites. RADEN is not affiliated with the Final Alert website. Questions? Email here.