| NOTE:
Before tackling this tutorial, I highly suggest you read the following
tutorial I wrote: Basic
Lighting Techniques Everything you need to know to get just the
right light setting in your maps!
Using the
Day/Night Loop
Want to learn how to make some specialized lighting triggers for your maps? Then this is the tutorial for you. You should also check out the tutorials on Day/Night Loops..one by
Wildefire and one by myself. Both attack that subject with different techniques but the same results. This tutorial will describe several triggers and their creation. This should get you well on your way to come up with your own unique triggers. This is the fourth and final installment of the Lighting Techniques tutorials.
Example #1: Day/Night Loop for Lamp
Posts
This trigger sequence is used in conjunction with Lamp posts and a Day/Night Looping sequence. You may use either
Wildefire's technique or the one I came up with for the looping trigger, it will make no difference. For the purposes of this tutorial I am using mine as it uses less triggers and it is being written by me
after all:) What we will be trying to accomplish is to turn a pair of Lamp Posts on and off again depending on the ambient levels of a particular map. There can be many uses for this, such as lighting up the side of a cliff face to simulate sunrise or sunset, enhancing the
campfire animation so that a Red "aura" surrounds the area in times of darkness, or turning off a starting position Lamp (like the TEMPDAYLMP) when the light level rises to full brightness.
First we need to make a test map..nothing fancy, just a small (50x50), two player, flat multiplayer map in the Temperate theater. Place a river from one end to the other, diagonally of course. Put the starting positions down so that the armies will be seperated by the river. This way we can see the results of our work without having to defend ourselves. Place a couple of Lamp Posts on the map in plain view. For this tutorial we will use the Alpha Type INREDLMP. This an invisible red lamp. We will not need ore, gems, or any other overlay for this map..not at this moment anyway. When your done you will have a flat map with nothing on it except a river and two Lamp posts.
Click on the
picture so you understand what it is:
Now we need to edit the lighting ambient level. We do this by going to the Lighting Settings screen (Edit>Lighting),and entering in a value of 0.35000 in the Ambient box for the normal settings.
We also need to edit the parameters of the lamp Posts themselves. This was covered in the earlier tutorial, "Lighting Techniques, ini editing" Enter the following parameter values into the map (you can just copy and paste them in from this doc.) [INREDLMP]
LightVisibility=950
LightIntensity=0.005
LightRedTint=.9
LightGreenTint=0.01
LightBlueTint=0.01
Next we need to make several triggers to set this up, the first being a reveal trigger. It is assumed that you know how to make triggers. If not then you need to learn by reading a tutorial and attempting simple triggers first. I will try to be explicit in this tutorial, but if you have no knowledge of them you may get lost. .
To make a reveal trigger we first select the trigger editor (Edit>Trigger editor) and type in the name of the trigger..Reveal, House =Civilian, Type=0 (nonrepeating). The event will be 13 Elapsed Time... and the Parameter value will be 2. For the Action we will select 16 Reveal all map. I will include a screen shot here for those of you that are not
familiar with the trigger editor. Click
on the picture below to see this:

Next we need a Day/Night Loop. This will consist of 5 separate triggers. I will not go into explicit detail on how to do this. There are two tutorials on RADEN covering this subject.
The left menu lists all the tuts available for viewing. The Trigger editor entries will be listed, but the whys and wherefores will not. We start by creating a new trigger and calling it "Start loop"..House set to Civilian, tag set 0 (nonrepeating).
Event =13 Elapsed Time...
Parameter value=2
Action0=53 Enable Trigger
Parameter value = %trigger ID % for "sunrise"
Action1=72 Set ambient rate...
Parameter value=1070000000
Action2=71 Set ambient step...
Parameter value=1019000000
Create a another trigger and name it "Sunrise", House set to Civilian, tag set to 2(repeating) and DISABLE it.
Event=13 Elapsed Time...
Parameter value= 50
Action0=73 Set ambient light...
Parameter value=95
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Sunrise"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Ambient up"
Create another trigger and name it "Ambient Up",House set to Civilian, tag set to 2 (repeating) and DISABLE it.
Event=46 Ambient light >= ...
Parameter value=95
Action0=53 Enable Trigger
Parmeter value=%triggerID% for "Sunset"
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Ambient up"
Create a another trigger and name it "Sunset", House set to Civilian, tag set to 2(repeating) and DISABLE it.
Event=13 Elapsed Time...
Parameter value= 50
Action0=73 Set ambient light...
Pameter value=35
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Sunset"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Ambient down"
Create another trigger and name it "Ambient Down",House set to Civilian, tag set to 2 (repeating) and DISABLE it.
Event=45 Ambient light <= ...
Parameter value=35
Action0=53 Enable Trigger
Parmeter value=%triggerID% for "Sunrise"
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Ambient down"
Okay, the map is now set up for the "Lamp Post Loop" sequence. We will incorporate this into the triggers that we just created in order to keep the number of triggers down to a minimum and thus keep the map file size as small as possible. This will keep the "lag factor" of the map as low as we can possibly get it. So with this in mind go to the "Start loop" trigger and add another Action Action3=53 Enable Trigger Parameter value=%triggerID% for "Lamps on" <
First lets fabricate our triggers..we will need two more.
Create a another trigger and name it "Lamps on", House set to Civilian, tag set to 2(repeating), and DISABLE it.
Attached trigger =%triggerID% for "Lamps off"
Event=45 Ambient light <= ...
Parameter value= 55
Action0=62 Turn on building
Parameter value=""
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Lamps on"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Lamps off"
Create a another trigger and name it "Lamps off", House set to Civilian, ( the tag setting does not matter as we will be deleting it) and DISABLE it.
Event=46 Ambient light >= ...
Parameter value= 56
Action0=61 Turn off building
Parameter value=""
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Lamps off"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Lamps on"
The next step is to edit the tags. You can do this from tag editor in FA2~YR, but you cannot do it with FA2 or the current version of Final Sun. (Matze?) With FA2~YR simply open the Tag Editor (Edit>Tag Editor) and find the tag for lamps off and delete it. We did this because we attached the trigger for this tag to the "Lamps ON" tag. This tag is no longer needed. The reason behind this is because now we need to attach the Lamp Posts to the Triggers. You cannot attach more than one trigger to an object, but you can designate (attach) a different tag for a trigger. In this way the tag for one trigger will be common to several different ones. This will become clear when you consider the fact that we need to attach the tag for the "Lamp On trigger to both of our Lamp Posts, but we also have to have them attached to the "Lamp Off" trigger.
If you are using either FA2 or FS then you will need to open the map with a text editor (Wordpad, Editpad, or Notebook). Using the search function find the [Tags] section and delete the tag for the "Lamps Off" trigger.
Double click on one of the lamp Posts and then select the %TriggerID% "Lamp on" tag . Repeat this routine for the other Lamp
Post.
Refer to the
picture below so you know what I'm talking about:

That completes this process. You now fire up the game and check it out. The game will start and 2 seconds later the map will be
completely unshrouded. The ambient light level will begin rise upward. Two dimly lit red lamps will be visible. The ambient level will rise to the value of 0.56000 and the lamps will turn off. The light will continue to rise until it peaks out at 0.95000 and then begin its downward run. When the light level reaches 0.55000 the lamps will turn on, and the light level will
continue to lower until the whole process starts over again.
When using the Day/Night Loop for this particular function remember to use as few Lamp posts as possible because they do cause significant lag.
Example #2: Day/Night Loop for Sound
Effects
This trigger sequence is also used in conjunction with the Day/Night Looping sequence. By employing the event, 45 Ambient light <= ... , and the event 46 Ambient light >= .... we can also turn ambient sound effects on and off. An example of this would be to have the _Amb_NightOwl sound effect running during the dark periods of the Day/Night Loop, turning off, and the _Amb_BirdsJungle1sound effect turning on when it was in the bright period.
To further set up the test map we will add 2 waypoints somewhere on the map. We will use waypoint #'s 10 and 11.
Now, add another action to the "Start Loop" trigger
Action4=53 Enable Trigger
Parameter=%trigger% for "Night Birds"
Okay, the map is now set up for the "Sound effect Loop" sequence. Again we will need to fabricate our triggers..we will need two more.
Create a another trigger and name it "Night birds", House set to Civilian, tag set to 2(repeating), and DISABLE it.
Event=45 Ambient light <= ...
Parameter value= 55
Action0=99 Play Sound Effect At...
Sound=__Amb_BirdsNightOwl
Waypoint=10
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Night Birds"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Day Birds"
Create a another trigger and name it *Day birds*, House set to Civilian, tag set to 2(repeating), and DISABLE it.
Event=46 Ambient light >= ...
Parameter value= 56
Action0=99 Play Sound Effect At...
Sound=_Amb_BirdsJungle1
Waypoint=11
Action1=54 Disable Trigger
Parameter value=%triggerID% for "Day Birds"
Action2=53 Enable Trigger
Parameter value=%triggerID% for "Night Birds"
This sequence is now complete and the __Amb_BirdsNightOwl sound effect will play when the ambient level is below 0.55000 at waypoint 10 and the Amb_BirdsJungle1 sound effect will be heard at waypoint 11 when the ambient level has risen above 0.56000.
This same technique can be used for the cricket and cricket bed sound effects or any other for that matter. Again let me caution you to use these sequences judicously as too many sound effects will cause the map to lag.
This completes this tutorial on the use of the Day/Night loop sequence in further enhancing your maps.
Check
out RVMECH's Basic
Lighting Tutorial!
|