Light commands
 
Specific commands for the Light entities: light, light_ramp, trigger_lightramp and trigger_SetLightStyle. Light entities are a subclass of trigger entities, they also respond to many trigger and entity commands (gameX86 source code reference: light.cpp).

Specific entity commands are colored in brown in my custom SinScript syntax coloring wordfile for UltraEdit32.


lightstyle
 
Function
 
This is used to set the lightstyle of a light entity. A normal light entity can be controlled directly but a light emitting brush face needs to be controlled through the intermediary of a trigger_SetLightStyle.

Syntax
 
$<light_name> lightstyle "<lightstyle_string>"

Notes & examples
 
Lightstyle strings in SiN offer much flexiblility because of 2 major features: individual color lightstyle control and lerping. Before we get into that, let's examine the basics of lightstyles:

Lightstyle strings are a series of letters to describe a periodic change in the intensity of a group of lights or surfaces. Each character in the string represents a light intensity for a portion of time. The letter m is nominal intensity, z is twice the nominal intensity, a is off.

So, if you want a light that ramps from dark to light and back again, you would use the following string:

abcdefghijklmlkjihgfedcba

For a flickering light, you could use:

mmmmmmammmmmamammmmamamaaaaammm

The number of characters in a lightstyle string represent the length of time the lightstyle string takes to cycle. Each character is 1/10th of a second, so divide the number of characters in a string by ten and you'll have the time it takes to run.

Now for individual color lightstyle control: you can also control the red, green, and blue components of a light individually.

To do this, just prefix your string with an upper case R, G or B to indicate what color the following string controls. To get other colors to be controlled, simply append an additional lightstyle string after it. For example, the following string produces a slow red fade in and out, then a harsh blue flicker:

RabcdefghijklmlkjihgfedcbaBmmmmmaaaaammmmmaaaaammmmm

The other new feature of Sin lightstyles is lerping. Lerping means a smooth gradual transition from one style letter to the next. So to smooth out a lightstyle, prefix the string with an upper case L. Here's an example:

This string will flicker on and off harshly:

amamamamam

This string will fade in and out smoothly:

Lamamamamam

You can also use lerping with individual colors, in the example below, the red lightstyle string will be smoothed and the second blue string won't:

LRamamamamamBmmmmmaaaaammmmmaaaaammmmm

The best way to get a feel for lightstyles is to experiment with them since the possibilities are virtually endless.

Note1:
Keep in mind that the R G B color letters and the L lerping letter must always be upper case and the lightstyle letters must always be in lower case so the game can tell the difference between them.


Note2:
Do not confuse this command with the lightstyle Lensflare command. It is an entirely different command with a different function even though it has the same name.



turnOff  
 
Function
 
This turns a light entity off.

Syntax
 
$<light_name> turnOff

Notes & examples
 

turnOn  
 
Function
 
This turns a light entity on.

Syntax
 
$<light_name> turnOn

Notes & examples