Vehicle Lights - user-grinch/ModelExtras GitHub Wiki

๐Ÿšฆ Overview

To activate lights in-game using the Model Extras plugin, you need to assign a specific material with the correct color to the mesh of the vehicle model. The plugin recognizes the material's purpose (e.g. brake, turn, tail) based on its color and automatically adjusts its brightness to simulate the light being turned on.

Each light material has two states:

Off โ€“ the default texture is displayed.

On โ€“ the same texture is shown, but with increased brightness applied automatically.

๐Ÿ’กTip: You can also assign a custom emissive texture for the "on" state. This is explained in the section below.

To simulate the light glow, place a node/dummy on the area of the mesh where a corresponding light material is applied. The name of the dummy determines the type of light. Based on this name, the plugin will know to enable a corona (glow effect) at that position.

The visual properties of each corona โ€” such as its color, direction, size, and intensity โ€” are defined in the vehicleโ€™s .jsonc config file (e.g. burrito.jsonc).

๐ŸŽฎ Key Controls

๐Ÿ”„ Indicator Lights

  • โฌ…๏ธ Z: Left turn signal
  • โน Left Shift: Turns off indicators
  • ๐Ÿ”ƒ X: Activates hazard lights (both turn signals)
  • โžก๏ธ C: Right turn signal

๐Ÿ”ง Miscellaneous

  • โ˜๏ธ J: Toggles fog lights
  • ๐Ÿ’ก G: Toggles long headlights
  • ๐ŸŒ† B: Toggles Spotlights
  • โžถ RMB: Rotates Spotlights

โœจ Variants

๐Ÿ”„ Indicator Lights

Indicator lights dynamically activate when turning or changing lanes, ensuring that vehicles visually communicate their intentions.

๐ŸŸข Supports both player & NPC vehicles

๐ŸŒซ๏ธ Fog Lights

Fog lights improve visibility in foggy or low-light conditions by illuminating the road directly ahead. They can be manually toggled by the player.

๐Ÿ”™ Reverse Lights

Reverse lights activate when the vehicle is in reverse gear, illuminating the area behind the vehicle and signaling other drivers.

๐Ÿ›‘ Brake Lights

Brake lights engage when the vehicle slows down or stops. This is recommended if the vehicle has a separate mesh for brake lights. If the vehicle uses the same mesh for both taillights and brakelights, this function will not be needed; the game will run as vanilla.

๐Ÿ“› North America - Dual Setup

This is the modern rear lighting system commonly found on American vehicles from the 1990s to the present day. In this setup, the brake and turn signal functions share the same light unit, while the tail light is a completely separate element โ€” often a thin strip or dedicated section of the rear light cluster (for those just use ๐ŸŒ™ light_night). This system is ideal for modern vehicles intended for use under North American traffic laws.


๐Ÿ“ƒ How it works:

  • ๐Ÿ”ด Stop Function: The main rear light turns on at full brightness when the brake pedal is pressed. (material + corona)
  • ๐Ÿ”ด Turn Function: The same light flashes when turn signals are active. If braking and turning at the same time, one side flashes while the other stays steady. (material + corona)
  • ๐Ÿ”ด Stop + Turn (Combined): The turning side flashes (turn signal has priority), the opposite side stays on as a brake light.


๐Ÿ’กTip: Stick to red materials and coronas for this setup โ€” American cars donโ€™t use amber indicators like most other countries do.

๐ŸŒŸ STT Lights โ€“ Old-School Single-Bulb Setup

Stop-Tail-Turn Lights are multifunctional rear lights that combine brake lights, tail lights, and turn signals into a single unit. This system was widely used in American vehicles from the 1950s to the 1980s, especially in classic sedans, muscle cars, and pickups โ€” making it ideal for retro-inspired cars in GTA San Andreas.


๐Ÿ“ƒ How it works:

  • ๐Ÿ”ด Stop Function: The light activates at full brightness when the brake pedal is pressed. (material + corona).
  • ๐ŸŸก Tail Function: The light stays on when the lights are turned on, providing rear visibility at night. (material + corona).
  • ๐Ÿ”€ Turn Function: The same light flashes on and off when the turn signals are active. (material + corona, At night, this light is never dim while braking or turning, only corona blinks).


๐Ÿ’กTip: Stick to red materials and coronas for this setup โ€” American cars donโ€™t use amber indicators like most other countries do.

๐Ÿšฅ Side Lights

Side lights work as side lights for vehicles bodies, often used on trucks and trailers. They turn on automatically at night, just like the "light_night" dummy, but they cast light shadows to the sides, respectively.

๐Ÿงฟโ€‹ Spot Lights

Spot lights are high-intensity directional lights mounted on a vehicle to provide illumination in a specific direction. They are typically used for off-road driving, law enforcement, emergency response, and utility work. Unlike standard headlights, which are designed to illuminate the road ahead, spotlights can be adjusted and aimed to focus on a particular area.

๐Ÿšจ Strobe Lights

Strobe lights are high-intensity flashing lights often used in emergency vehicles, law enforcement, or show vehicles. They create a distinctive flashing effect that grabs attention and enhances visibility in critical situations.

๐Ÿ“ƒ How it works:

  • โšก Strobes will automatically flash on and off at a rapid rate.
  • ๐Ÿ” Each strobe is independent, allowing varied flashing patterns via configuration.
  • ๐ŸŽ›๏ธ Their flashing behavior can be adjusted via JSONC config


๐Ÿ’กTip: Ideal for emergency vehicles like police cars, ambulances, fire trucks, or even futuristic custom vehicles.

โ˜€๏ธ Other Light Types

They turn on according to the times indicated by their respective dummies, working automatically.

  • ๐Ÿ”ธ light_day: will remain on only during the day and will turn off at night.
  • ๐Ÿ”น light_night: will remain on during the night and will be off during the day.
  • ๐Ÿ”ธ light_allday: will always be on, regardless of the time.

๐Ÿท๏ธ Node (dummy), Naming & Material Colors (RGB)

๐Ÿšฅ Turn Signals

  • ๐Ÿ”ธ indicator_lf / turnl_lf โ†’ Left Front Indicator Material Color: 183 255 0
  • ๐Ÿ”น indicator_rf / turnl_rf โ†’ Right Front Indicator Material Color: 255 58 0
  • ๐Ÿ”ธ indicator_lm / turnl_lm โ†’ Left Middle Indicator Material Color: 182 255 0
  • ๐Ÿ”น indicator_rm / turnl_rm โ†’ Right Middle Indicator Material Color: 255 57 0
  • ๐Ÿ”ธ indicator_lr / turnl_lr โ†’ Left Rear Indicator Material Color: 181 255 0
  • ๐Ÿ”น indicator_rr / turnl_rr โ†’ Right Rear Indicator Material Color: 255 56 0

๐ŸŒซ๏ธ Fog Lights

  • โšช foglight_l / fogl_l โ†’ Left Fog Light Material Color: 255 174 0
  • โšช foglight_r / fogl_r โ†’ Right Fog Light Material Color: 0 255 199

๐Ÿ”™ Reverse Lights

  • โฌ…๏ธ reversingl_l / revl_l โ†’ Left Reverse Light Material Color: 255 173 0
  • โžก๏ธ reversingl_r / revl_r โ†’ Right Reverse Light Material Color: 0 255 198

๐Ÿ›‘ Brake Lights

  • ๐Ÿ”ด breaklight_l / breakl_l โ†’ Left Brake Light Material Color: 184 255 0
  • ๐Ÿ”ด breaklight_r / breakl_r โ†’ Right Brake Light Material Color: 255 59 0

๐Ÿšฅ Side Lights

  • โฌ…๏ธ sidelight_l โ†’ Left Side Light Material Color: 255 200 1
  • โžก๏ธ sidelight_r โ†’ Right Side Light Material Color: 255 200 2

๐ŸŒŸ STT Lights

  • โฌ…๏ธ sttlight_l โ†’ Left STT Light Material Color: 255 200 3
  • โžก๏ธ sttlight_r โ†’ Right STT Light Material Color: 255 200 4

๐Ÿ“› NA Brake Lights

  • ๐Ÿ”ด nabrakelight_l โ†’ Left Brake Light Material Color: 255 200 5
  • ๐Ÿ”ด nabrakelight_r โ†’ Right Brake Light Material Color: 255 200 6

๐Ÿงฟโ€‹ Spotlights

  • ๐Ÿ”ฆ spotlight_lightX โ†’ X can be any number, allowing for more different spotlights. Material Color: 255 200 7
  • โญฏ spotlight_dummy โ†’ Object that will be rotated from its pivot along with the spot lights.

๐Ÿšจ Strobe Lights

  • โšก strobe_light1 โ†’ Material Color: 255 199 1
  • โšก strobe_light2 โ†’ Material Color: 255 199 2
  • โšก strobe_light3 โ†’ Material Color: 255 199 3
  • โšก strobe_light255 โ†’ Material Color: 255 199 255

Each strobe dummy must be paired with a specific material color for the plugin to recognize and animate them correctly. You can create up to 255 unique strobe light instances, by naming each dummy as strobe_light1, strobe_light2, ..., up to strobe_light255.

๐Ÿ“Œ You can add strobedelay (in milliseconds) in the JSONC to specify the amount of delay time

โ˜€๏ธ Other Light Types

  • ๐Ÿ”† light_day โ†’ Day Light Material Color: 0 18 255
  • ๐ŸŒ™ light_night โ†’ Night Light Material Color: 0 16 255
  • โณ light_allday โ†’ All Day Light Material Color: 17 18 255

๐ŸŽจ Custom ON Textures for Lights

You can assign a custom texture for any light, which is especially useful when simulating modern LED lighting. In real-world LEDs, the bulb itself is usually clear or white, while the emitted light can be any color.

๐Ÿ”ง To achieve this effect in-game:

  1. Assign the material with a regular "off" texture, just like you would normally.
  2. Then, add a custom "_on" texture to either the vehiclename.txd, vanilla vehicle.txd or vehfuncs vehicle2.txd.

๐Ÿงช Example:
Letโ€™s say you use this textures setup:

  • led_indicator โ†’ used as the OFF state (assigned to the model material too).
  • led_indicator_on โ†’ acts as the ON state (glowing version).

You can place the texutre led_indicator_on inside:

  • banshee.txd โ†’ per-vehicle custom glow.
  • vehicle.txd โ†’ shared glow for multiple vehicles.
  • vehicle2.txd โ†’ shared glow for multiple vehicles with vehfuncs feature.
    ๐Ÿ” Notice: If both TXDs contain a texture with the same name, the version in vehiclename.txd(banshee.txd in example) will take priority.

๐Ÿ’กPro Tip: You can combine this method with the VehFuncs feature, which allows you to have up to five different vehicle.txd files (vehicle2.txd to vehicle5.txd). However, Model Extras currently only recognizes the off texture from the vehicle2.txd to vehicle5.txd files supported by VehFunc. This limitation may be addressed in a future update.

๐Ÿ’ฅโ€‹ Damage Detection

A feature designed to deactivate a light when a vehicle part is damaged. To use it, simply place the light dummy as a child of the respective node. ๐Ÿงช Example: Placing the "reversingl_l" dummy as a child of the boot_dummy node will deactivate the left reverse light when the vehicle's boot is damaged.

โš™๏ธ Configuration _prm (Legacy)

๐Ÿšจ This method is for compatibility with older ImVehFt-adapted vehicles. Prefer switching to the recommended method for better features and stability.

๐Ÿ”ง Parameters format: _prmRRGGBBXYZ

๐Ÿ“Œ Dummy name limit: Keep it under 23 characters to avoid crashes.

๐Ÿ”น RR: Red color (HEX)
๐Ÿ”น GG: Green color (HEX)
๐Ÿ”น BB: Blue color (HEX)
๐Ÿ”น X: Light type (0: Directional, 1: Inversed-Directional, 2: Non-Directional)
๐Ÿ”น Y: Corona size (0-9)
๐Ÿ”น Z: Shadow size (0-9)

โš™๏ธ Configuration (Recommended)

Instead of renaming nodes in the model, use a JSONC file stored in ModelExtras/data/ or anyware in the modloader/

๐Ÿ“‚ File Location & Structure

๐Ÿ“Œ Path: ModelExtras/data/<FILENAME>.jsonc or ๐Ÿ“Œ Path: modloader/AnyFolderInModloader/<FILENAME>.jsonc

Both model & modelname are valid FILENAME. 602.jsonc or alpha.jsonc both are valid (602 is the model index for the vehicle 'alpha`).
๐Ÿ’กTip: It is recommended to use model names instead of model IDs to avoid conflicts with other mods โ€” especially when using added vehicles.

{
  "lights": {
    "YOUR_DUMMY_NAME": {
      "corona": {
          "color": { "red": 0, "green": 255, "blue": 0, "alpha": 200 },
          "size": 0.5,
          "type": "directional"
      },
      "shadow": { 
          "color": { "red": 0, "green": 255, "blue": 0, "alpha": 200 },
          "rotationchecks": true,
          "size": 1.0,
          "texture": "pointlight"
      }
      "strobedelay": 0
    }
  }
}

๐Ÿ“Œ YOUR_DUMMY_NAME must match the model node/dummy name (e.g., indicator_lr, fogl_l, revl_r).

  • It must be the same name that exists in the model. If there is a _prim parameter in the dummy name, it should be ignored. Jsonc will override it.
  • You do not need to assign all the parameters to the dummy, if the parameter is not defined, it will use the default configuration. Some dummies, like spotlight for example, will have only some of the functional parameters.

๐Ÿ’ก Corona

Define the corona brightness settings.

๐ŸŽจ Color

Defines corona color. "R" is red, "G" is green, "B" is blue, "A" is alpha or intensity. (0-255).

๐Ÿ”† Size

Defines the size of the light corona.
๐Ÿงช Examples: 0.1, 0.2, 0.3, 0.5...

๐Ÿ”ƒโ€‹ Type

Sets the corona viewing direction. Supported types:

  • directional: Default view of the dummy corona.
  • inversed-directional: Reverse corona display. Will light in the opposite direction to default.
  • non-directional: The light is visible from every direction. Note: This may appear unrealistic on vehicles, as the glow can shine through geometry.

โšซ Shadow

Defines the settings for the light projection on the floor.
๐Ÿ“Œ detail: Shadows for dummies taillights2 and headlights2 are disabled by default. Putting a "shadow" section inside it's JSONC entry will force enable it.

๐ŸŽจ Color

Defines the shadow color. If not set, it will use the corona color value. "R" is red, "G" is green, "B" is blue, "A" is alpha or intensity. (0-255).

๐Ÿ”„โ€‹ rotationchecks

By default, ModelExtras casts shadows only outward from the vehicle, relative to its center. Set this flag to true to disable it.

๐Ÿ”† Size

Defines the size of the shadow.
๐Ÿงช Examples: 0.1, 0.2, 0.3, 0.5...

๐Ÿ–ผ๏ธ Texture

Changes texture for the shadow. Allowed names: tightfocused, foglight, narrow, pointlight, round, spotlight, taillight_bike, etc... (shadows textures from me_texdb.txd file).

๐Ÿ•’ Strobe Delay

Defines the delay time for strobe lights in milliseconds.
๐Ÿงช Examples: 100, 500, 1000...

โš ๏ธ **GitHub.com Fallback** โš ๏ธ