>> Games >> Star Trek Elite Force II
Summary System Requirements
Genre: First Person Shooter
Platforms: PC, Mac
PC Publisher: Activision
Mac Publisher: Aspyr Media
Engine: Quake III, with Ritual's ÜBER Tools
ESRB Rating: Teen
Released: June 24, 2003
· DirectX 9.0 compatible 32MB video card
· Pentium III 600 or Athlon™ processor or higher
· 128MB of RAM
· Microsoft® Windows® 98/98SE/ME/2000/XP
· DirectX® 9.0 compatible 16 bit sound card
· DirectX® 9.0
(more...)
Tutorial: Creating and Controlling Dynamic Lights

Create your lights

Figure 1
Create your light by right clicking on the 2D view and choosing "light" from the entity menu (FIGURE 1). Setup any values you would like by pressing ' n ' when the light is selected (shift + left click on the light to select it). Next, in the entity properties window, click the check box for "DYNAMIC". Finally, give your light a group_name by typing "group_name" into the "key" text box and name it "light01" in the "value" text box. This group_name of "light01" will be used in the script file to control its dynamic behavior.

Create your script file

I will assume you know how to create a script file for your level. If not, seek out a tutorial on scripting for EF2.

To make your light dynamic and flicker on and off you need to have this line of code in a thread.

$world.light_lightstyle( "light01", "aaaaazzzzzaaaaazzzzzjjaaaaaazzzzaaaajaaaajzzzzzazazazajjzaaaaazzkahjszwufkjaz", 0 );

You will always write $world.light_lightstyle. That is a special function that allows you to control your specific lights. You see "light01" is in quotes, this tells the function which light entity you want it to control. The actual controlling of the flickering pattern comes in where you see all the letters, 'a', 'z', etc. Pitch black is 'a' and full bright is 'z'. "aaaa" is pitch black for four seconds because each letter represents one second. So "zz" would be full bright for two seconds. The final 0 can be either 0 or 1. 0. '0' indicates this pattern loops continuously while '1' indicates it only happens once.

Play around with the different letter combinations you can come up with for different flickering results. You can look at the dlights.scr file included in the zip file (at the bottom of this tutorial) to experiment.

Another lighting command is $world.light_fade and you use it as $world.light_fade( "light02", 0, 10 );. "light02" is the group_name of the light you want to fade from default brightness down to 0 brightness (pitch black) over 10 seconds.

This concludes the dynamic lights tutorial.

Tips
  • Press ' i ' to bring up a light editor that will help you modify many lighting properties of the selected light(s).
  • Hold down on shift + ctrl + alt and press ' ] ' to increase the "falloff_start_dist" and "falloff_end_dist" of the light(s).
  • Hold down on shift + ctrl + alt and press ' [ ' to decrease the "falloff_start_dist" and "falloff_end_dist" of the light(s).
Download Example Map

http://game.rbkdesign.com/ef2/example_maps/dlights.zip

Includes (1) dlights.bsp, (1) dlights.map, (1) dlights.scr