Headlight color
-
how do i change the color of the headlights of a specific car?
-
void _SET_VEHICLE_HEADLIGHTS_COLOUR(Vehicle vehicle, int color);
above is FiveM
Google it.or this one, SP
_SET_VEHICLE_NEON_LIGHTS_COLOUR(Vehicle vehicle, int r, int g, int b) // 0x8E0A582209A62695 b323Native.Function.Call(Hash._SET_VEHICLE_NEON_LIGHTS_COLOUR, vehicle1, 255, 255, 255)
I'm not a modder, but you might need this one too:
_SET_VEHICLE_NEON_LIGHT_ENABLED(vehicle, i, true);
-
@DaDrifter
Very basically (Edit: it started 'basic', but there's no way to explain everything 'basically' so here you go. Don't worry, it's way easier to do than it is to explain is all, you won't have any trouble with it
, I'm just attempting to cover all the bases etc)
In your vehicle's 'carvariations.ymt/.meta' file your vehicle will have a 'lightSettings value':
Example:
<lightSettings value="58"/>
That value (58 in this case, but yours could be anything) refers to an '<id value' in the '<lights>' section in a 'carcols.ymt/.meta' file somewhere in the game (you'll have to find it, easy if it's an add-on, it'll usually be in the 'carcols.meta' in the add-on 'dlc.rpf', if not, try 'carcols.ymt' (for values 0>76 anyway)):
Example (carcols full '<lights>' section '<id value' entry):
<Item> <id value="58"/> <indicator> <intensity value="0.37500000"/> <falloffMax value="2.50000000"/> <falloffExponent value="8.00000000"/> <innerConeAngle value="20.00000000"/> <outerConeAngle value="50.00000000"/> <emmissiveBoost value="false"/> <color value="0xFFFF7300"/> <textureName/> <mirrorTexture value="true"/> </indicator> <rearIndicatorCorona> <size value="0.00000000"/> <size_far value="0.00000000"/> <intensity value="0.00000000"/> <intensity_far value="0.00000000"/> <color value="0x00000000"/> <numCoronas value="1"/> <distBetweenCoronas value="128"/> <distBetweenCoronas_far value="255"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.00000000"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </rearIndicatorCorona> <frontIndicatorCorona> <size value="0.00000000"/> <size_far value="0.00000000"/> <intensity value="0.00000000"/> <intensity_far value="0.00000000"/> <color value="0x00000000"/> <numCoronas value="1"/> <distBetweenCoronas value="128"/> <distBetweenCoronas_far value="255"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.00000000"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </frontIndicatorCorona> <tailLight> <intensity value="0.00000000"/> <falloffMax value="0.10000000"/> <falloffExponent value="16.00000000"/> <innerConeAngle value="45.00000000"/> <outerConeAngle value="90.00000000"/> <emmissiveBoost value="false"/> <color value="0xFFFF0000"/> <textureName/> <mirrorTexture value="true"/> </tailLight> <tailLightCorona> <size value="1.20000000"/> <size_far value="2.50000000"/> <intensity value="5.00000000"/> <intensity_far value="1.00000000"/> <color value="0xFFFF0F05"/> <numCoronas value="1"/> <distBetweenCoronas value="128"/> <distBetweenCoronas_far value="255"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.00000000"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </tailLightCorona> <tailLightMiddleCorona> <size value="0.00000000"/> <size_far value="0.00000000"/> <intensity value="0.00000000"/> <intensity_far value="0.00000000"/> <color value="0x00000000"/> <numCoronas value="1"/> <distBetweenCoronas value="128"/> <distBetweenCoronas_far value="255"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.00000000"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </tailLightMiddleCorona> <headLight> <intensity value="1.50000000"/> <falloffMax value="35.00000000"/> <falloffExponent value="16.00000000"/> <innerConeAngle value="0.00000000"/> <outerConeAngle value="60.00000000"/> <emmissiveBoost value="false"/> <color value="0xFF7FA7E3"/> <textureName>VehicleLight_car_LED1</textureName> <mirrorTexture value="false"/> </headLight> <headLightCorona> <size value="0.10000000"/> <size_far value="7.00000000"/> <intensity value="7.00000000"/> <intensity_far value="5.00000000"/> <color value="0xFF61A5FF"/> <numCoronas value="2"/> <distBetweenCoronas value="41"/> <distBetweenCoronas_far value="130"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.92362800"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </headLightCorona> <reversingLight> <intensity value="0.50000000"/> <falloffMax value="7.20000000"/> <falloffExponent value="32.00000000"/> <innerConeAngle value="20.00000000"/> <outerConeAngle value="78.00000000"/> <emmissiveBoost value="false"/> <color value="0xFFFFFFFF"/> <textureName/> <mirrorTexture value="true"/> </reversingLight> <reversingLightCorona> <size value="0.80000000"/> <size_far value="2.00000000"/> <intensity value="1.50000000"/> <intensity_far value="1.00000000"/> <color value="0x00F7F7F7"/> <numCoronas value="1"/> <distBetweenCoronas value="128"/> <distBetweenCoronas_far value="255"/> <xRotation value="0.00000000"/> <yRotation value="0.00000000"/> <zRotation value="0.00000000"/> <zBias value="0.25000000"/> <pullCoronaIn value="false"/> </reversingLightCorona> <name>ninef</name> </Item>
In the '<headLight>' section of any light id:
Example:
<headLight> <intensity value="1.50000000"/> <falloffMax value="35.00000000"/> <falloffExponent value="16.00000000"/> <innerConeAngle value="0.00000000"/> <outerConeAngle value="60.00000000"/> <emmissiveBoost value="false"/> <color value="0xFF7FA7E3"/> <!-- hex colour value here --> <textureName>VehicleLight_car_LED1</textureName> <!-- 'graphics.ytd' texture name here --> <mirrorTexture value="false"/> </headLight>
there are two things that can influence the colour of the headlights (they combine to create the exact colour displayed in-game):
The hex colour value in the '<color value' line:
The hex colour value relates to an exact colour. In my example, '0xFF7FA7E3' is a light blue colour.
& the texture used in the '<textureName>' line:
The textures for headlights are stored in 'graphics.ytd' here:...\mods\update\update.rpf\x64\textures\graphics.ytd
with all vanilla car ones starting with 'vehiclelight_car_'
Making a Vehicle's Headlight Colour Unique:
Complications can arise with editing an individual vehicle's headlight colour because many vehicles share the same'<lights>' '<id value' section in 'carcols.ymt/.meta' & as a result, use the same hex colour values & textures. So changing any values in any one carcols '<lights>' '<id value' section is likely to affect multiple vehicles etcSolution:
You can however create your own totally unique '<lightSettings value' (carvariations)/light '<id value' (carcols) value (both the same value, but unique & unused elsewhere in the game) by copying & duplicating a full carcols '<id value' section (like my second 'Example (carcols full '<lights>' section '<id value' entry):' above) & then changing the '<id value' to a number unused elsewhere in the game (you can place the duplicated data in any 'carcols.ymt/.meta' loaded by the game & it will work).Multiple Routes to the Same Outcome:
You then edit the '<headLight>' section however you want (editing the hex '<color value' value line to another colour for example. Use the site linked above to find other hex colours & add '0xFF' to the site's hex value to use in carcols).You can do the same/similar for the 'vehiclelight_car_' textures in 'graphics.ytd'. Just duplicate one of them & rename it (the game accepts any name).
Export a 'vehiclelight_car_' texture (using OpenIV texture viewer), rename to anything you want & then import it back into 'graphics.ytd' & then edit the carcols '<headLight>' '<textureName>' line to that of whatever name you decided to call the new texture.You will then be free to edit that texture however you like (even reposition it to change the height of the headlight beam in-game) & have it only affect the vehicle/s you want it to.
Whichever way you do it (carcols hex '<color value=' line edit, 'graphics.ytd' texture edit or a combination of the two). After you finish, just make sure to set the carvariations '<lightSettings value' of your vehicle to the same value as you chose for the carcols '<lights> section' '<id value' duplicate & you should be good