Modifying light levels - Doom Legacy Wiki

Modifying light levels

From Doom Legacy Wiki

Jump to: navigation, search
Editing Tutorials

Modifying light levels in Doom Legacy is sort of an easy thing that is no longer restrained by the old Doom linedef types. Apart from them, you get the whole Boom additions to the engine and the possibilities that FraggleScript adds.

Shortly, there are three different ways of changing lights in Legacy: by using standard doom types, Boom extended types and scripting.

1. Using Doom linetypes.

Doom has eight different types of linedefs you can use to change lighting. Those with a W in front of them are Walk type so they´re activated when the player crosses the linedef. The others with the S are Switch ones, activated when the player presses the "use" key on them. To use these lines, just tag the desired line to the selected sectors and activate it. The types are as following:

(13) W1 Light Change to Brightest
The player walks through the line and the tagged sector(s) are set 
to a brightness of 255. Usable only once.

(12) W1 Light Change to Brightest Adjacent - The player walks 
through the line and the tagged sector(s) are set to the level 
of the brightest adjacent sector (of the tagged sect. Usable only once.

(35) W1 Light Change to Darkest - The player walks through the line and 
the tagged sector(s) are set to a brightness of 0. That means you won´t 
see a thing. Usable only once.

(104) W1 Light Change to Darkest Adjacent - The player walks through 
the line and the tagged sector(s) are set to the level of the darkest 
adjacent sector (of the tagged sect. Usable only once.

(17) W1 Light Start Blinking - The player walks through the line 
and the tagged sector(s)´s light starts blinking between two levels
(the brighter one is the light level in the tagged sector. The darker
level is the minimum neighbor light level, or 0 if all neighbor
sectors have lighting greater than or equal to the sector's at the
time of activation (from the Boom docs)). Usable only once.

(81) WR Light Change to Brightest - The player walks through the 
line and the tagged sector(s) are set to a brightness of 255. Usable multiple times.

(80) WR Light Change to Brightest Adjacent - The player walks 
through the line and the tagged sector(s) are set to the level of 
the brightest adjacent sector (of the tagged sect. Usable multiple times.

(79) WR Light Change to Darkest - The player walks 
through the line and the tagged sector(s) are set to a brightness of 0. 
That still means that you won´t be able to see a thing. Usable multiple times.

(138) SR Light Change to 255 - The player presses the switch and the tagged 
sector(s) are set to a bright of 255. Usable multiple times.

(139) SR Light Change to 35 - The player presses the switch and the tagged 
sector(s) are set to a bright of 35. Usable multiple times.

2. Using Extended Boom Linetypes.

The Boom compatibility offers you the possibility to use another bunch of linedefs so you can alter lighting. They are used as the regular Doom ones. You get the following:

(170) S1 Light Change to 35 - The player presses the switch and the tagged 
sector(s) are set to a brightness of 35. Usable only once.

(171) S1 Light Change to 255 - The player presses the switch and the tagged 
sector(s) are set to a brightness of 255. Usable only once.

(192) SR Light Change to Brightest Adjacent - The player activates the switch
and the tagged sector(s) are set to the level of  the brightest adjacent sector 
(of the tagged sector(s)). Usable multiple times.

(169) S1 Light Change to Brightest Adjacent - The player activates the switch
and the tagged sector(s) are set to the level of the brightest adjacent sector 
(of the tagged sector(s)). Usable only once.

(194) SR Light Change to Darkest Adjacent - The player activates the switch
and the tagged sector(s) are set to the level of the darkest adjacent sector (of the tagged
sector(s). Usable multiple times.

(173) S1 Light Change to Darkest Adjacent - The player activates the switch
and the tagged sector(s) are set to the level of the darkest adjacent sector (of the tagged
sector(s). Usable only once.

(157) WR Light Change to Darkest Adjacent - The player walks through 
the line and the tagged sector(s) are set to the level of the darkest 
adjacent sector (of the tagged sect. Usable multiple times.

(193) SR Light Start Blinking - The player activates the switch 
and the tagged sector(s)´s light starts blinking between two levels
(the brighter one is the light level in the tagged sector. The darker
level is the minimum neighbor light level, or 0 if all neighbor
sectors have lighting greater than or equal to the sector's at the
time of activation (from the Boom docs)). Usable multiple times.

(172) S1 Light Start Blinking - The player activates the switch 
and the tagged sector(s)´s light starts blinking between two levels
(the brighter one is the light level in the tagged sector. The darker
level is the minimum neighbor light level, or 0 if all neighbor
sectors have lighting greater than or equal to the sector's at the
time of activation (from the Boom docs)). Usable only once.

(156) WR Light Start Blinking - The player walks through the line 
and the tagged sector(s)´s light starts blinking between two levels
(the brighter one is the light level in the tagged sector. The darker
level is the minimum neighbor light level, or 0 if all neighbor
sectors have lighting greater than or equal to the sector's at the
time of activation (from the Boom docs)). Usable multiple times.

3. Using FraggleScript.

If what listed before is not enough for you, Doom Legacy has the possibility of using FraggleScript to freely change the light level of any sector. The change on the light level may happen in two ways: all of a sudden or gradually. Each of them has its own functions that we´re gonna discuss right now.

If you want your lights to change all of a sudden you use the lightlevel function. The syntax goes like this:

lightlevel(int tagnum, {int level})

Where tagnum is the sector tag you want the lights to change and level is the light level you wish to put in it. Notice that Doom will only take light into consideration in steps of 16 units. There´s no difference between 8 and 9 but there is between 0 and 16. A possible script:

script 1
{
lightlevel(10, 255);
}

The script above will set all sectors tagged 10 at full light level. You can even simulate blinks with some loops:

script 1
{
while(1)
  {
  lightlevel(10, 255);
  wait(50);
  lightlevel(10, 64);
  wait(50)
  }
}

But you could use the regular Doom stuff for that too... We mentioned that your lights could change gradually too. This is achieved with the usage of the fadelight function, whose syntax goes like that:

fadelight(int tagnum, int level, {int speed})

Where tagnum and level are the same as in the previous example and adds an optional parameter: speed. If you just don´t add the speed parameter the lights will gradually fade at a speed of 1. You can achieve higher changing speeds with higher numbers or lower with lesser. An example:

script 1
{
fadelight(10, 255, 0.5);
}

The script above will slowly light up the sectors with the tag number 10... Believe me, it can be used for some moody atmospheres in your wads... Anyway, that´s all you needed to know about lights!.

Personal tools