Skip to content
RED+
Contents

Lighting

Follow lights

A follow light links faces to a light. In the editor, the linked faces follow the light's brightness, so they brighten and dim as it flickers. Tools, Wire Follow Lights (RF+) then adds the events that make the light flicker in game, and makes the linked faces' texture dim in step with it.

Set up the light

  1. Select the light and open Light Properties.
  2. Tick Dynamic. RED+ warns in the log if a linked light is not Dynamic.
  3. In Light Brightness & Flicker, enter the On and Off times in the Time (s) column. A time under 0.1 s counts as 0.1 s.
  4. Tick Fade for a gradual change between on and off. For random timing, enter any +/- time over 0.01 s. The amount itself is not used.
  5. Note the light's UID. Tools, Select Objects... lists every object with its UID in parentheses, and can sort By UID.

The linked faces flicker in the viewports only while the light's Initial Light State is a flickering state. On shows them at a steady Intensity, and Off at a steady Off Intensity.

  1. Select the faces in Texture mode (Shift+T) and open Face Properties (Ctrl+P).
  2. In Follow Light, type the light's UID in Light UID.
  3. Click OK.
  • A face follows one light. Any number of faces can follow the same light.
  • 0 removes the link.
  • With several faces selected that follow different lights, the field shows (mixed). Leave it that way to keep each face's link.
  • Link faces of built geometry. On a brush you have just made, rebuild the geometry first (Space, see Rebuild Geometry): RED+ keeps the link by the face's ID, which a face gets when the geometry is built, and a link on a brush that has not been built yet is lost.

In the editor

The linked faces are drawn at the light's current brightness: its Intensity when it is on, its Off Intensity when it is off, and in between while it fades. They flicker with the light in the viewports while it is in a flickering state.

After you wire the level, the light is set to steady On, so its faces stay at its Intensity in the editor.

Wire the level

Save the level in a folder inside user_maps, such as user_maps\multi, before you wire it. The generated textures then go in user_maps\textures\RFplus of the Red Faction folder the level is in. RED+ finds that folder by cutting the level's path at \user_maps\. An unsaved level uses user_maps\textures\RFplus in the folder that RF_DIR in redplus.ini names. Without RF_DIR, no textures are made and the light reports NOT WIRED.

Choose Tools, Wire Follow Lights (RF+). The command is also in the RED+ menu. For each light that has linked faces, it:

  1. Adds a trigger and a set of events, each named RF+FL followed by the light's UID and a short label:
    • start, an auto trigger that fires once when the level starts.
    • clock, a Cyclic_Timer that repeats every On plus Off seconds, forever.
    • Set_Light_Color events that turn the light on in its own colour and off (black).
    • ATX_Set_Frame events that switch the faces' texture between its bright and dark frames at the same moments.
  2. Makes a copy of each texture the linked faces use, named after the texture and the light's UID, with four darker versions (75, 50, 25 and 6 % brightness) and an .atx file that lists the five frames.
  3. Puts the copy on the linked faces. Other faces that use the same texture keep the original and do not dim.
  4. Sets the light to steady On. The events do the flickering in game.
  5. Marks the level as changed and its geometry for rebuilding.

The events are placed in rows below the light, kept above the room's floor.

Fade and random timing

  • With Fade ticked, the light and the texture step down and back up in four steps. The fade takes a quarter of the shorter of the On and Off times, and at most 1 s.
  • With any +/- time over 0.01 s, the timing is random; the amount is not used. The clock ticks at the shorter of the On and Off times. At each tick a Switch_Random event picks on or off, through two Delay events, weighted so the light is on for about its share of On time. That share is rounded to fifths, from 1 in 5 to 4 in 5. Fade is not used in this mode.

The report

When it finishes, RED+ shows a report. The first line says how many lights were fully wired, for example Follow-light wiring: 2 of 3 light(s) fully wired. A locked light counts in the total but never as fully wired. Then there is one line per light:

  • OK, with the number of textures and faces wired. RED+ checks each OK line by reading the texture back off the faces.
  • NOT WIRED, with the reason. If the events were built, the line adds that the light itself still flickers.
  • LOCKED, for a locked light.
ReasonWhat to do
light object not found in this levelThe UID is not a light in this level. Fix Light UID on the faces.
the light's runtime record is unavailableRED+ could not read the light's settings and skipped it. Send the log with a problem report.
has no surface in the compiled worldThe linked face is removed when geometry is built, for example an open face between rooms. Link the face you can see.
its generated texture could not be loaded by the editorSave, restart RED+ and run Wire Follow Lights again.
no face texture could be generated (see editor.log)Save the level inside user_maps before you wire it. If it is saved, a face texture is paletted or DXT and cannot be read. The log it names is logs\RedPlusEditor.log.
face N still has textureFace N still shows the texture the line names, not its generated copy. Run Wire Follow Lights again. If the line stays, send the log with a problem report.
is not on any compiled world faceThe generated texture the line names is on none of the light's faces. Run Wire Follow Lights again. If the line stays, send the log with a problem report.

The report lists the next steps: build geometry, then Calculate Lighting, then save and pack the level, in that order.

If no face follows a light, the command says No faces are linked to a light (Face Properties > Follow Light). Nothing to wire.

The log also warns when a linked light is not dynamic (is NOT dynamic), and when a texture cannot be read, for example a paletted one. A texture that cannot be read gets no darker copies.

Run it again

Run Wire Follow Lights again after you change a light's flicker settings or the textures of its faces. It updates its own objects in place, by name, so nothing is duplicated. It also:

  • removes RF+FL objects that the light's current settings do not need, for example the fade steps after you untick Fade,
  • deletes the light's generated files for textures its faces do not use,
  • puts faces you unlinked back on their original texture.

Lock and unlock

When a light is wired the way you want, lock it. Select one or more lights, then choose Tools, Lock Follow-Light Wiring (RF+). Tools, Unlock Follow-Light Wiring (RF+) undoes it. With no light selected, RED+ says Select one or more LIGHTS first.

Wire Follow Lights leaves a locked light's textures, RF+FL objects and faces alone, and never regenerates its textures. The report lists it as LOCKED. Locks are saved with the level.

Remove the wiring

There is no single command for this. For one light:

  1. Unlock the light if it is locked.
  2. Set Light UID to 0 on its faces.
  3. If other lights in the level still have linked faces, run Wire Follow Lights: it puts the unlinked faces back on their original texture. If restoring <original>.tga fails, the face is left as it is and the log warns. If no face follows a light any more, apply the original texture to those faces yourself.
  4. Delete the light's RF+FL objects.
  5. Set the light's Initial Light State back to the state you want.

To remove the light's files from user_maps\textures\RFplus, delete them yourself. That folder is shared by every level in the same Red Faction folder, so delete a light's files only if no level uses them.

When RED+ opens a level, it drops links to a light that is no longer in the level, and locks on a light that is gone. The log window says how many settings it dropped.

Which games show it

The events are Alpine Faction events, and the faces use an .atx texture, which needs Alpine Faction 1.4. In Alpine Faction 1.4 the light flickers and the linked faces dim with it. See Which game plays what RED+ saves.

The game does not read loose textures from a subfolder of user_maps\textures, so it finds the generated textures only in the packed level. See Create a level packfile.