Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Difference between revisions of "lightstyle"

From Quake Wiki

(Other Details:)
m (Other Details:)
Line 14: Line 14:
 
'''a''' is pitch black (off) and '''z''' is full brightness (in engines with overbright lighting, this is actually double brightness, '''m''' is normal brightness).
 
'''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.
 
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!).
 
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.
 
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.
  
 
[[Category:QuakeC Function]]
 
[[Category:QuakeC Function]]

Revision as of 04:52, 2 May 2013

Syntax:

void lightstyle(float style, string value)

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

Parameters:

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

Returns:

void

Example:

lightstyle(15, "azazaaazzz");

Other Details:

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.