I would like to create parts with bodycolored lights for the moonhawk Here's a quick overview of the desired effect ( I got it by replacing the "moonhawk_lights_d.dds" file by a green texture ) In order to create a separate part, I tried duplicating and renaming the name of the lights in the .dae, but the materials referenced aren't the same that the material "moonhawk_lights", the one where the file "moonhawk_lights_d.dds" is referenced. I can only find materials like "moonhawk_highbeam", "moonhawk_lowbeam", ... , witch doesn't have any room to change the texture name, and I don't really get what these materials refers to and how they are linked to the "moonhawk_lights" material. So, I don't really get how to create separated parts and link them to the texture in this case ( also i want to make this texture bodycolored, but let's keep it one question at the time )
You'll need to use the skinning system to globally change the Moonhawk lights texture, instead of changing individual meshes. I just did this for the ETK 2400i (it has optional clear turn signals) and this is the only way to make it work. First, you have to make a slot for the lights skin. Create a slot called "skin_lights" in the Moonhawk's body .jbeam, or anywhere, really - you could put the slot inside a part that uses the "moonhawk_mod" slot to avoid overwriting/modifying original files. Then you'll need to write some jbeam for the lights skin part (it doesn't matter what file you put it into; you can just make a new one). It'll look like this: Code: "moonhawk_skin_lights_alt": { "information":{ "authors":"BeamNG", "name":"Body Colored Lights", "value":100, }, "slotType" : "skin_lights", "globalSkin" : "lights_alt", }, In the materials.cs, you'll need to have something like this. This is for a general idea of the formatting - the actual material will be different, since you'll need instanceDiffuse in order for it to be body colored. Note that you will need a skin version of every lights material (lights, lights_on, lights_on_intense, and lights_dmg). Code: singleton Material("moonhawk_lights.skin_lights.lights_alt") { mapTo = "moonhawk_lights.skin_lights.lights_alt"; diffuseMap[1] = "vehicles/moonhawk/moonhawk_lights_d_alt.dds"; specularMap[1] = "vehicles/moonhawk/moonhawk_lights_s.dds"; normalMap[1] = "vehicles/moonhawk/moonhawk_lights_n.dds"; diffuseMap[0] = "vehicles/common/null.dds"; specularMap[0] = "vehicles/common/null.dds"; normalMap[0] = "vehicles/moonhawk/moonhawk_lights_n.dds"; specularPower[0] = "128"; pixelSpecular[0] = "1"; specularPower[1] = "128"; pixelSpecular[1] = "1"; diffuseColor[0] = "1 1 1 1"; diffuseColor[1] = "1 1 1 1"; useAnisotropic[0] = "1"; useAnisotropic[1] = "1"; castShadows = "1"; translucent = "1"; translucentBlendOp = "None"; alphaTest = "0"; alphaRef = "0"; diffuseColor[1] = "1.5 1.5 1.5 1"; dynamicCubemap = true; materialTag0 = "beamng"; materialTag1 = "vehicle"; }; singleton Material("moonhawk_lights_on.skin_lights.lights_alt") { mapTo = "moonhawk_lights_on.skin_lights.lights_alt"; diffuseMap[2] = "vehicles/moonhawk/moonhawk_lights_g_alt.dds"; specularMap[2] = "vehicles/moonhawk/moonhawk_lights_s.dds"; normalMap[2] = "vehicles/moonhawk/moonhawk_lights_n.dds"; diffuseMap[1] = "vehicles/moonhawk/moonhawk_lights_d_alt.dds"; specularMap[1] = "vehicles/moonhawk/moonhawk_lights_s.dds"; normalMap[1] = "vehicles/moonhawk/moonhawk_lights_n.dds"; diffuseMap[0] = "vehicles/common/null.dds"; specularMap[0] = "vehicles/common/null.dds"; normalMap[0] = "vehicles/moonhawk/moonhawk_lights_n.dds"; specularPower[0] = "128"; pixelSpecular[0] = "1"; specularPower[1] = "128"; pixelSpecular[1] = "1"; diffuseColor[0] = "1 1 1 1"; diffuseColor[1] = "1.5 1.5 1.5 1"; diffuseColor[2] = "1.5 1.5 1.5 0.15"; useAnisotropic[0] = "1"; useAnisotropic[1] = "1"; useAnisotropic[2] = "1"; castShadows = "1"; translucent = "1"; translucentBlendOp = "None"; alphaTest = "0"; alphaRef = "0"; dynamicCubemap = true; glow[2] = "1"; emissive[2] = "1"; materialTag0 = "beamng"; materialTag1 = "vehicle"; }; singleton Material("moonhawk_lights_on_intense.skin_lights.lights_alt") { mapTo = "moonhawk_lights_on_intense.skin_lights.lights_alt"; diffuseMap[2] = "vehicles/moonhawk/moonhawk_lights_g_alt.dds"; specularMap[2] = "vehicles/moonhawk/moonhawk_lights_s.dds"; normalMap[2] = "vehicles/moonhawk/moonhawk_lights_n.dds"; diffuseMap[1] = "vehicles/moonhawk/moonhawk_lights_d_alt.dds"; specularMap[1] = "vehicles/moonhawk/moonhawk_lights_s.dds"; normalMap[1] = "vehicles/moonhawk/moonhawk_lights_n.dds"; diffuseMap[0] = "vehicles/common/null.dds"; specularMap[0] = "vehicles/common/null.dds"; normalMap[0] = "vehicles/moonhawk/moonhawk_lights_n.dds"; specularPower[0] = "128"; pixelSpecular[0] = "1"; specularPower[1] = "128"; pixelSpecular[1] = "1"; diffuseColor[0] = "1 1 1 1"; diffuseColor[1] = "1.5 1.5 1.5 1"; diffuseColor[2] = "1.5 1.5 1.5 0.25"; useAnisotropic[0] = "1"; useAnisotropic[1] = "1"; useAnisotropic[2] = "1"; castShadows = "1"; translucent = "1"; translucentBlendOp = "None"; alphaTest = "0"; alphaRef = "0"; dynamicCubemap = true; glow[2] = "1"; emissive[2] = "1"; materialTag0 = "beamng"; materialTag1 = "vehicle"; }; singleton Material("moonhawk_lights_dmg.skin_lights.lights_alt") { mapTo = "moonhawk_lights_dmg.skin_lights.lights_alt"; diffuseMap[1] = "vehicles/moonhawk/moonhawk_lights_dmg_d_alt.dds"; specularMap[1] = "vehicles/moonhawk/moonhawk_lights_dmg_s.dds"; normalMap[1] = "vehicles/moonhawk/moonhawk_lights_dmg_n.dds"; diffuseMap[0] = "vehicles/common/null.dds"; specularMap[0] = "vehicles/common/null.dds"; normalMap[0] = "vehicles/moonhawk/moonhawk_lights_dmg_n.dds"; specularPower[0] = "128"; pixelSpecular[0] = "1"; specularPower[1] = "128"; pixelSpecular[1] = "1"; diffuseColor[0] = "1 1 1 1"; diffuseColor[1] = "1 1 1 1"; useAnisotropic[0] = "1"; useAnisotropic[1] = "1"; castShadows = "1"; translucent = "1"; translucentBlendOp = "None"; alphaTest = "0"; alphaRef = "0"; diffuseColor[1] = "1.5 1.5 1.5 1"; dynamicCubemap = true; materialTag0 = "beamng"; materialTag1 = "vehicle"; };
Thank you so much ! It took me some time to do it as I am not used to jbeam, but I did it, it works perfectly ! I would have never figured it out without your help. Also, I guess the method you described could be used to add another selectable skin to any part of a vehicle, witch is awesome !