The Light Command


    light [type=type] [color=color] [brightness=brightness] [radius=radius] [name=name] [fx=fx] [time=time] [angle=angle] [pitch=pitch]


Note: the light command is new in Outerworlds 3.1 and requires 3.1 or later in order to function.

The light command causes an object to emit light into the surrounding scene. The light emits from the center of the object (as determined by its bounding box, not its origin) and shines on any surrounding polygons facing towards the object. The light command has many optional arguments:

The type specifies the type of light source, which can be either "point" or "spot". "Point" light sources shine equally in all directions, and are the default if no type is specified. "Spot" light sources shine a "cone" of light in a particular direction.

The color specifies the color of the light source and can either be specified as one of many preset word values or as a "raw" hexadecimal value giving the red/green/blue component values (the same format as used for the "BGCOLOR=" tag in HTML).

The brightness specifies how brightly the light source shines. Brightness is specified as a positive floating-point value. The default brightness is 0.5.

The radius specifies the maximum distance away the light shines, in meters. Objects beyond this distance from the light will receive no illumination from the light. The default radius is 10 meters. The radius is particularly useful for preventing lights from shining outside the room in which they are placed; since Outerworlds does not currently support shadows, walls and other objects do not stop lights from shining into adjacent rooms or buildings. Note that the radius is subject to a maximum value as set in the world features for each world.

The name specifies the name of another nearby object to place the new light on.

The fx argument specifies one of several optional lighting "effects" that can be applied to the light source. All of the effects cause the brightness of the object to vary over time. They include:

blink - causes the light to alternate equally between on and off

fadein - causes the light to fade in from dark to full brightness

fadeout - causes the light to fade out from full brightness to dark (after which it deletes itself from the object)

fire - causes the light to flicker randomly like a flame

flicker - causes the light to switch off for a brief period at random intervals

flash - causes the light to switch on for a brief period at random intervals

pulse - causes the light to fade in and then back out at regular intervals

The time argument specifies the interval in seconds for the blink, pulse, fadein, and fadeout effects. It has no effect for the other effects. The default time is 1 second.

The angle and pitch arguments control "spot" light sources. The angle specifies how wide (in degress) a cone of light emits from the spot; the default is 45 degrees. The pitch specifies the angle up from straight down that the spot light points. The default pitch is 0, meaning spot light point straight down by default.

Note that light sources require additional CPU time to render and thus should be used sparingly. Each new light source added to a scene will reduce the frame rate by a small amount. Excessive use of extra lights can severely impact the performance of an area or world.

Also, note that the degree to which a light source "shines" on a particular object is also a function of the diffuse component of the surface lighting properties of that object. The lower the diffuse lighting component of the object, the less a light source will influence it. If an object has no diffuse lighting, light sources will not have any effect on it.

Each object may have only one light source applied to it at a time.


    create light

This creates a white point light source at the center of the object

    create light color=orange fx=fire

This creates an orange light source that flickers like a flame.

    activate light type=spot color=blue name=ceiling pitch=45

This creates an object that when clicked on, creates a spot light source pointing down at a 45 degree angle from any nearby objects named "ceiling".

    create light color=red brightness=3 fx=pulse time=5

This creates a bright red light source (3 times normal brightness) that fades in and out every 5 seconds.