lightstyle

From Quake Wiki

Syntax:[edit]

void lightstyle(float style, string value)

Changes a light style in-game. In stock Quake, this is used to make switchable lights.

Parameters:[edit]

style - The light style to affect.
value - The string of letters that make up the lightstyle's brightness values.

Returns:[edit]

void

Example:[edit]

lightstyle(15, "azazaaazzz");

Other Details:[edit]

The string value is a sequence of letters representing different brightness levels. a is pitch black (off) and z is full brightness (in engines with overbright lighting, this is actually double brightness, m is normal brightness). Each letter is played for 0.1 seconds and when the engine gets to the end of the sequence, it loops back to the beginning.

It is important to note that a light style is global and will affect all lights in the level that are tagged with a particular light style. Setting style 0 will affect all normal lights in the level (including sunlight and minlight!).

In stock quake, this was used to create switchable lights by alternating between 'm' and 'z' values when triggered, but you can also use it to change light patterns or to fade lights on and off.

There are 64 light styles, from 0 to 63. If the style is not strictly comprised in characters from a to z, the game may crash. Styles 32-62 are assigned by the light program for switchable lights.