Vehicle Lights - user-grinch/ModelExtras GitHub Wiki
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).
- โฌ ๏ธ Z: Left turn signal
- โน Left Shift: Turns off indicators
- ๐ X: Activates hazard lights (both turn signals)
- โก๏ธ C: Right turn signal
- โ๏ธ J: Toggles fog lights
- ๐ก G: Toggles long headlights
- ๐ B: Toggles Spotlights
- โถ RMB: Rotates Spotlights
Indicator lights dynamically activate when turning or changing lanes, ensuring that vehicles visually communicate their intentions.
๐ข Supports both player & NPC vehicles
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 activate when the vehicle is in reverse gear, illuminating the area behind the vehicle and signaling other drivers.
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.
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.
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 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 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 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.
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.
-
๐ธ 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
-
โช foglight_l / fogl_l โ Left Fog Light
Material Color: 255 174 0
-
โช foglight_r / fogl_r โ Right Fog Light
Material Color: 0 255 199
-
โฌ
๏ธ reversingl_l / revl_l โ Left Reverse Light
Material Color: 255 173 0
-
โก๏ธ reversingl_r / revl_r โ Right Reverse Light
Material Color: 0 255 198
-
๐ด breaklight_l / breakl_l โ Left Brake Light
Material Color: 184 255 0
-
๐ด breaklight_r / breakl_r โ Right Brake Light
Material Color: 255 59 0
-
โฌ
๏ธ sidelight_l โ Left Side Light
Material Color: 255 200 1
-
โก๏ธ sidelight_r โ Right Side Light
Material Color: 255 200 2
-
โฌ
๏ธ sttlight_l โ Left STT Light
Material Color: 255 200 3
-
โก๏ธ sttlight_r โ Right STT Light
Material Color: 255 200 4
-
๐ด nabrakelight_l โ Left Brake Light
Material Color: 255 200 5
-
๐ด nabrakelight_r โ Right Brake Light
Material Color: 255 200 6
-
๐ฆ spotlight_light
X
โ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_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
-
๐ 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
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:
- Assign the material with a regular "off" texture, just like you would normally.
- Then, add a custom "_on" texture to either the
vehiclename.txd
, vanillavehicle.txd
or vehfuncsvehicle2.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 invehiclename.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.
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.
๐จ 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
)
Instead of renaming nodes in the model, use a JSONC file stored in ModelExtras/data/
or anyware in the modloader/
๐ 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.
Define the corona brightness settings.
Defines corona color. "R" is red, "G" is green, "B" is blue, "A" is alpha or intensity. (0-255
).
Defines the size of the light corona.
๐งช Examples: 0.1, 0.2, 0.3, 0.5...
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.
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.
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
).
By default, ModelExtras casts shadows only outward from the vehicle, relative to its center. Set this flag to true
to disable it.
Defines the size of the shadow.
๐งช Examples: 0.1, 0.2, 0.3, 0.5...
Changes texture for the shadow. Allowed names: tightfocused, foglight, narrow, pointlight, round, spotlight, taillight_bike, etc... (shadows textures from me_texdb.txd file).
Defines the delay time for strobe lights in milliseconds.
๐งช Examples: 100, 500, 1000...