Skins are special parts that replace specific materials with different materials when equipped. They are mostly used for vehicle liveries or other paint designs, as well as selecting interior colors and designs.
Skins have a lower priority than glowMaps , so in order to replace a material using a skin, all 3 output materials defined in the glowMap need to be replaced. They also have a lower priority than deformGroups , so the damaged variant of the material also has to be replaced.
They are defined as global modifiers in the root part of Jbeam, similarly to license plate properties. As such, they are seen by every component of the vehicle.
Global modifiers
These two modifiers can be used interchangably. The only difference is that skinName will not be reported by some systems when dumping data in the console.
Material syntax
The replacement materials of the skins are defined in materials.json files like normal materials. Usually, they are present in a separate file called skin.materials.json for clarity. The way the skin will work is defined in the "mapTo"
section of the material (which is usually the same as the name for clarity). It has 3 parts separated by dots:
"mapTo": "pickup.skin.ambulance",
The first part is the mapTo value of the material that will be replaced. On most vehicles, the material containing the exterior paint will have the same mapTo value as the name of the vehicle.
The second part is the material slot. Material slots allow different parts to replace different materials. The material slot is determined by the slotType of the slot where the part that calls the skin is. The material slot will be the same as slotType if the slotType contains "skin_"
in the name. When the slotType is "paint_design"
, then the material slot will be just "skin"
.
The material slot can be overwritten in Jbeam by using the "skinType"
property like so:
{
"nine_skin_taxi": {
"information":{
"authors":"BeamNG",
"name":"Taxi Cab",
"value":0,
},
"slotType" : "skin_nine_sedan",
"skinType" : "skin_body",
"skinName" : "taxi",
},
}
This is useful when slotType is a table and therefore cannot be used as a material slot:
{
"nine_skin_twotone_custom": {
"information":{
"authors":"BeamNG",
"name":"Two Tone Custom Paint",
"value":5000
},
"slotType" : ["skin_nine_roadster","skin_nine_coupe","skin_nine_sedan","skin_nine_van","skin_nine_panelvan","skin_nine_pickup"],
"skinType" : "skin_body",
"skinName" : "twotone_custom"
},
}
The third part is the skin name. This is defined by the global modifiers described in the section above. They can be used interchangably, but for the sake of clarity, it’s better to use globalSkin on skins that modify the main exterior paint, and skinName on all others.
The rest of the syntax is the same as a normal material. Refer to the skin system reference page and material examples for further details.
Dynamic Textures
Dynamic Textures is an auxiliary skin present on every vehicle which allows it to be painted via the livery editor in career mode. The Jbeam syntax should look like this:
{
"moonhawk_skin_dynamicTextures": {
"information":{
"authors":"BeamNG",
"name":"Dynamic Textures",
"isAuxiliary": true,
"value":1350
},
"slotType" : "paint_design",
"dynDecalMaterials": ["moonhawk", "moonhawk_nosecone_alt"],
"globalSkin" : "dynamicTextures"
},
}
It includes an optional Jbeam section called dynDecalMaterials, which is a table with materials of the vehicle the system will affect. If this section is not present, the system will affect a material with the same name as the vehicle.
Please note that dynamicDecals only work on the "paint_design"
slotType and are not compatible with the skinType modifier.
Simple example
A standard vehicle livery.
Jbeam:
"pickup_skin_ambulance": {
"information":{
"authors":"BeamNG",
"name":"Ambulance Livery",
"value":5000,
},
"slotType" : "paint_design",
"globalSkin" : "ambulance",
},
Beginning of skin.materials.json:
"pickup.skin.ambulance": {
"name": "pickup.skin.ambulance",
"mapTo": "pickup.skin.ambulance",
"class": "Material",
/* ... */
},
Advanced examples
- A skin that replaces the visual look of vehicle lights.
Jbeam:
"etki_skin_lights_alt": {
"information":{
"authors":"BeamNG",
"name":"Alternate Lights",
"value":200
},
"slotType" : "skin_lights",
"globalSkin" : "lights_alt"
},
All the relevant materials in skin.materials.json:
"etki_lights.skin_lights.lights_alt": {
"name": "etki_lights.skin_lights.lights_alt",
"mapTo": "etki_lights.skin_lights.lights_alt",
"class": "Material",
/* ... */
},
"etki_lights_dmg.skin_lights.lights_alt": {
"name": "etki_lights_dmg.skin_lights.lights_alt",
"mapTo": "etki_lights_dmg.skin_lights.lights_alt",
"class": "Material",
/* ... */
},
"etki_lights_on.skin_lights.lights_alt": {
"name": "etki_lights_on.skin_lights.lights_alt",
"mapTo": "etki_lights_on.skin_lights.lights_alt",
"class": "Material",
/* ... */
},
"etki_lights_on_intense.skin_lights.lights_alt": {
"name": "etki_lights_on_intense.skin_lights.lights_alt",
"mapTo": "etki_lights_on_intense.skin_lights.lights_alt",
"class": "Material",
/* ... */
},
- A skin with skinType property.
Jbeam:
"nine_skin_van_a": {
"information":{
"authors":"BeamNG",
"name":"Macaroni and Beans",
"value":0,
},
"slotType" : ["skin_nine_van","skin_nine_pickup"],
"skinType" : "skin_body",
"skinName" : "van_a",
},
Materials:
"nine_main.skin_body.van_a": {
"name": "nine_main.skin_body.van_a",
"mapTo": "nine_main.skin_body.van_a",
"class": "Material",
/* ... */
},