Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Editing lightstyle
From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | ====Syntax:==== | |
+ | <code>void lightstyle(float style, string value)</code> | ||
− | == | + | Changes a light style in-game. In stock Quake, this is used to make switchable lights. |
− | + | ====Parameters:==== | |
+ | :<code>style</code> - The light style to affect. | ||
+ | :<code>value</code> - 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. | |
− | + | ||
− | + | 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |