Color

From The DarkMod Wiki
Jump to navigationJump to search

Note:

The name of this article contains no underscore at the front due to technical limitations of the wiki. The correct name is _color.

The _color spawnarg consists of three space-separated color values for red, green and blue. Each is expressed as a decimal fraction of range 0.0-1.0. The spawnarg sets simultanously the three spawnargs shaderParm0, shaderParm1 and shaderParm2.

This spawnarg is often used to set RGB colors for materials that contain a color stage. Thus different entities with different _color spawnargs will be colored differently in the game.

Usage

Setting in DR

In the Entity Inspector, add the _color spawnarg with a dummy value (which will be interpreted as "black"), then select that item to see in the lower Inspector panel:

  • an additional text-edit field with either:
    • the name of a recognized standard color; or
    • in all other cases, "rgb(<n1>,<n2>,<n3>)", where each <...> is in the range 0-255
  • and a color swatch button.

You can text-edit either the _color spawnarg triplet value directly or via this additional text field, and it will change the other textual form and the color swatch.

Furthermore, clicking on the swatch button brings up the color picker, where you can pick the color:

  • visually with the mouse, or
  • by RGB values, each of range 0..255 (and it is far easier to edit these here, separately, than in the field discussed above)
  • by Hue/Saturation/Luminance values

No matter how chosen, when done, the settings will be in the required format.

With Flame-Attached Entities like Cagelights and Wall Torches

If you wish to dim or recolor the light cast by a torch or brazier, which is typically due to an attachment named "flame", you would use the spawnarg "set _color on flame" [note the space after 'set'], with the triplet values in the required format. This adjusts the brightness and coloration of the light thrown, but will not affect how the flame itself appears. (For that, see Colored Flame Lights).

TIP: "set _color on flame" doesn't provide you with a color picker. Temporarily add a _color spawnarg to get the picker. Use it to choose your color and generate the needed triplet, which you can then copy over to "set _color on flame".

See also