Day&Night Cycles for Beginners
From AgeofWiki
Introduction: U_Spawn_U's Triggers for Beginners Guide Series Presents The Day & Night Cycles For Beginners Guide. This Guide Shows you how to create a Day and Night Cycle With Triggers using up to 4 different parts of the day including Dawn, Daylight , Dust and Nighttime. It will tell you the exact Effects and Conditions to use and it will also teach you how to customize this to your liking and teach you to understand what each Trigger is doing. A Day & Night Cycle is a very nice feature to add to you scenario, The following guide shows you how to create a basic Day & Night Cycle with consists of 4 lighting settings, you could also you this guide as a base to create even more complex Cycles using more then 4 lighting settings.
World Menu: On the Lighting Menu the Fields = Preset Lighting:304a_base
Triggers Menu:Recreate the following Groups and Triggers to create a basic Day & Night Cycle that last for 30mins.
Group 1 Group Name: Day & Night Cycle Triggers: Activate Cycle | Dusk | Nighttime | Dawn | Daytime
Trigger 1 Trigger Name:Activate Cycle | Active:Yes | Loop:No | Run Immediately:No | Priority:Med Conditions: Timer:Fields= Seconds:5 Effects: Fire event:Fields= Trigger:Dusk
Trigger 2 Trigger Name:Dusk | Active:No | Loop:No | Run Immediately:No | Priority:Med Conditions: Timer:Fields= Seconds:450 Effects: Set lighting:Fields= Set Name:London sunset | Fade In:45 Fire event:Fields= Trigger:Nighttime
Trigger 3 Trigger Name:Nighttime | Active:No | Loop:No | Run Immediately:No | Priority:Med Conditions: Timer:Fields= Seconds:450 Effects: Set lighting:Fields= Set Name:302b_cavelighiting | Fade In:45 Fire event:Fields= Trigger:Dawn
Trigger 4 Trigger Name:Dawn | Active:No | Loop:No | Run Immediately:No | Priority:Med Conditions: Timer:Fields= Seconds:450 Effects: Set lighting:Fields= Set Name:301a_Malta | Fade In:45 Fire event:Fields= Trigger:Daytime
Trigger 5 Trigger Name:Daytime | Active:No | Loop:No | Run Immediately:No | Priority:Med Conditions: Timer:Fields= Seconds:450 Effects: Set lighting:Fields= Set Name:304a_base | Fade In:45 Fire event:Fields= Trigger:Dusk
Understanding The Triggers: Now recreating these triggers should not be hard, but if you have never done triggers then you would have no idea what each trigger is doing and how to customize it to your liking. So we will go through each effect and condition and what they do. Conditions Used:
The Timer Condition was the only on used in this group of Triggers, this is very simply as it has only one Field, This Condition wait for a certain time before activating its effects. It contains the followings Fields | Seconds: In this field you put how many seconds you want before the condition activates the effects.
Effects Used:
The Set lighting Effect was one of the two effects used in this group of Triggers, It has two Fields, This Effect will change the Lighting of the map, the Lighting of the map is like a over shadow color. It contains the followings Fields | Set Name: In this Field you put the name of the Lighting set that you want to use, each lighting set has a different type of overshadow giving a different effect. | Fade In: In This Field you put the amount of seconds that you want the transition of the 2 difference Lighting to go for, so if you put 45 seconds in it will slowly fade into the next Lighting set.
The Fire event Effect was one of the two effects used in this group of Triggers, It has one Field. This Effect will Activate a Trigger that is Inactivate. It contains the followings Fields | Trigger: In this field from the scroll down list select the trigger you wish to activate.
So, what is happening all together is, the Activate Cycle trigger activates the Dusk trigger, now once this trigger ones timer is done, it's changes the lighting and it fires the Nighttime triggers, now this repeats the processes of the last one, after the timer is done it changes the lighting and it fires the Dawn trigger, this then after its timer is up does the same it changes the lighting and fires the Daytime trigger, it is one again the same and it after its timer it will change the lighting and fire the Dusk Triggers, and it keeps repeating the processes like that.
Customization: Now that you understand how the Effects And Conditions work you can now customize the Day & Night Cycle to your liking So I'll show you what you need to do to you Effects And Conditions to customize the cycle
Conditions Used: In Timer Condition you will notice that in Triggers 2-5 the Seconds at set to 450 each giving a total time of 1800 seconds which is 30 Minutes, now say you want a shorter or longer day cycle all you have to do is convert X Minutes into Seconds and then divide it by 4 and you have a shorter or longer Day and night Cycle So for say a 10 minute cycles you change it into seconds, that's 600 seconds and divide that by 4 giving you 150, and by putting that into the timer field you get a 10 minute day and night cycle.
Effects Used: In Set lighting Effect you will first notice the Set Name: Field in this field you can change the different lighting sets to set it up the way you like it but remember to keep it looking like a real day cycle, I made a small list that has at least 3 Lighting sets that work good for each section of the Cycle.
Daytime
201a
304a_base
Amsterdam
Berlin
Dusk
London Sunset
308b_carribbeanlight
amsterdam evening
Dawn
301a_malta
306a_carribbean
spc14abuffalo
Nighttime
302b_cavelightiting
spc14anight
st_petersburg_night
Next is the Fade In: Field , in this you will see i have 45 seconds now you should not have below 10 second as it no minimum fade time but anywhere below 10 seconds it not smooth enough, know i think that your fade time should be at least 10% of the total time the lighting set is on, but to improve this you could up it to 25% and even more to get smoother. Now if you want it to look like the lighting is always changing then all you have to do is have the fade in time 2 seconds shorter then the condition timer, this looks best in longer time cycles as you don't notice a change at all and it slowly changes.
Extras:Now the way to really give effect to your day & night cycle is to combine it with other features. Now adding sound could give a good effect if you get the right sounds for the time of day, say for instance you have bird sounds from dawn to daytime and own sounds from dusk to nighttime, this can be done by just adding a few more effects such as music play and music stop and have the music file having the sounds you want. Other things are such as making the cycle fire other triggers that will make sure at night that the people in a town go into houses, and at camp sites campfires go up and so on. Also in a rpg to give more effect you could make so quests only available at different times adding great use to the cycle
Conslusion: Now you know should how to create a day & night cycle as well as understand the effects and conditions used and know many different ways to customize the cycle to your liking, if you still do not understand read thought this article again and you should get it as long as you read carefully, so good luck and I hope this help you.
This Article is part of the Triggers for Beginners Guide Series, for other great and helpful articles click Here
