SOLVED - Texture Issues with Engine Swaps

Discussion in 'Content Creation' started by djkontraktor, Dec 28, 2017.

  1. djkontraktor

    djkontraktor
    Expand Collapse

    Joined:
    Jul 8, 2016
    Messages:
    12
    Hi, I'm working on a nasty project... Making a clone of the 353 V8 out of the Barstow that will seamlessly fit into a Hopper (as an engine option). Very much like the common real world Chevy 350 engine swap into a Jeep Wrangler.
    So far, so good. I've gotten it driving with no errors, and it is 10 barrels of thrill to drive. You can really feel that heavy motor up front too, and handling can suffer a bit as a result. I managed to tinker with the code and copy some important assets from the Barstow's folder into my new mod. The 3D models look great, except...

    ...No Textures! All the parts "stolen" from the Barstow are wrapped in the dreaded orange filler texture.




    Inside my mod's engine.jbeam, I have this section declaring my 353 V8 engine option.


    Code:
    "barstow_engine_v8_353": {
        "information":{
            "authors":"djkontraktor",
            "name":"353 CUI V8 Engine (djkontraktor)",
            "value":1200,
        }
        "slotType" : "hopper_engine",
        "slots": [
            ["type", "default", "description"]
            ["hopper_exhaust","hopper_exhaust", "Exhaust"],
            ["hopper_transmission","hopper_transmission_5M", "Transmission"],
            ["hopper_intake_v8","hopper_intake_v8_carb","Intake"{"coreSlot":true}],
            ["n2o_system","", "Nitrous Oxide System"],
        ],
        "powertrain" : [
            ["type", "name", "inputName", "inputIndex"],
            ["combustionEngine", "mainEngine", "dummy", 0],
        ],
        "mainEngine": {
            "torque":[
                ["rpm", "torque"]
                [0, 0],
                [500, 245],
                [1000, 365],
                [1500, 454],
                [2000, 502],
                [2500, 513],
                [3000, 514],
                [3500, 503],
                [4000, 473],
                [5000, 370],
                [6000, 310],
                [7000, 220],
                [8000, 100],
            ],
            //engine performance
            "idleRPM":700,
            "maxRPM":4800,
            "hasRevLimiter":false,
            "inertia":0.25,
            "friction":22
            "dynamicFriction":0.027,
            "burnEfficiency":[
                [0, 0.1],
                [0.05, 0.21],
                [0.4, 0.26],
                [0.7, 0.33],
                [1, 0.22],
            ],
            "torqueReactionNodes:":["e1l","e2l","e4r"]
            "energyStorage": "mainTank",
            "requiredEnergyType":"gasoline",
    
            //exhaust
            "particulates":0.05
            "instantAfterFireCoef": 0.5,
            "sustainedAfterFireCoef": 0.5,
    
            //cooling and oil system
            "thermalsEnabled":true
            "engineBlockMaterial":"iron"
            "oilVolume":9
    
            //engine durability
            "cylinderWallTemperatureDamageThreshold":140
            "headGasketDamageThreshold":1500000
            "pistonRingDamageThreshold":1500000
            "connectingRodDamageThreshold":2000000
         
            "maxTorqueRating": 690,
            "maxOverTorqueDamage": 150,
    
            //node beam interface
            "waterDamage": {"[engineGroup]:":["engine_intake"]}
            "radiator": {"[engineGroup]:":["radiator"]}
            "engineBlock": {"[engineGroup]:":["engine_block"]}
            "breakTriggerBeam":"engine",
            "uiName":"Engine",
    
            "soundConfig": "soundConfig",
        },
        "soundConfig": {
            "sampleName": "V8_2",
            "mainGain": -18,
            "maxLoadMix": 0.6,
            "minLoadMix": 0,
            "onLoadGain":1,
            "offLoadGain":0.65,
            "eqLowGain": -5,
            "eqLowFreq": 150,
            //"eqLowWidth": 0,
            "eqHighGain": -5,
            "eqHighFreq": 6000,
            //"eqHighWidth": 0,
            "lowCutFreq":90,
            //"eqFundamentalGain": -15,
        },
        "vehicleController": {
            "clutchLaunchStartRPM":1500,
            "clutchLaunchTargetRPM":2000,
            //**highShiftDown can be overwritten by automatic transmissions**
            "highShiftDownRPM":[0,0,0,2600,2850,2950,3050,3050]
            //**highShiftUp can be overwritten by intake modifications**
            "highShiftUpRPM":5000
        },
        "flexbodies": [
            ["mesh", "[group]:", "nonFlexMaterials"],
            ["barstow_engine_v8_423", ["hopper_engine"],[]{"pos":{"x":0,"y":0.35,"z":0.22}}],
            ["barstow_header_v8_423", ["hopper_engine"],[]{"pos":{"x":0,"y":0.35,"z":0.22}}],
        ],
        "nodes": [
             ["id", "posX", "posY", "posZ"],
             {"frictionCoef":0.5},
             {"nodeMaterial":"|NM_METAL"},
             {"selfCollision":false},
             {"collision":true}
             {"group":"hopper_engine"},
             {"engineGroup":"engine_block"}
             {"nodeWeight":37.38},
             {"chemEnergy":2000,"burnRate":0.39,"flashPoint":800,"specHeat": 0.2,"selfIgnitionCoef":false,"smokePoint":650,"baseTemp":"thermals","conductionRadius":0.2},
             ["e1r", -0.13, -0.94, 0.20],
             ["e1l", 0.13, -0.94, 0.20],
             ["e2r", -0.13, -1.50, 0.30],
             ["e2l", 0.13, -1.50, 0.30],
             {"chemEnergy":false,"burnRate":false,"flashPoint":false, "specHeat": false,"selfIgnitionCoef":false,"smokePoint":false,"baseTemp":false,"conductionRadius":false},
             {"selfCollision":true},
             {"engineGroup":["engine_block","engine_intake"]}
             ["e3r", -0.32, -0.94, 0.76],
             ["e3l", 0.32, -0.94, 0.76],
             ["e4r", -0.32, -1.50, 0.76{"isExhaust":"mainEngine"}],
             ["e4l", 0.32, -1.50, 0.76],
             {"engineGroup":""}
             {"group":""},
        ],
        "beams": [
              ["id1:", "id2:"],
              {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
              {"beamSpring":20001000,"beamDamp":500},
              {"beamDeform":250000,"beamStrength":"FLT_MAX"},
              //engine
              ["e1r","e1l"],
              ["e2r","e2l"],
              ["e3r","e3l"],
              ["e4r","e4l"{"isExhaust":"mainEngine"}],
    
              ["e1r","e2r"],
              ["e1l","e2l"],
              ["e3r","e4r"],
              ["e3l","e4l"],
    
              ["e1r","e3r"],
              ["e1l","e3l"],
              ["e2r","e4r"],
              ["e2l","e4l"],
    
              ["e2r","e3r"],
              ["e2l","e3l"],
              ["e2r","e3l"],
              ["e2l","e3r"],
    
              ["e1r","e4r"{"isExhaust":"mainEngine"}],
              ["e1l","e4l"{"isExhaust":"mainEngine"}],
              ["e1r","e4l"],
              ["e1l","e4r"],
    
              ["e1r","e2l"],
              ["e1l","e2r"],
              ["e3r","e4l"],
              ["e3l","e4r"],
    
              ["e1r","e3l"],
              ["e1l","e3r"],
              ["e2r","e4l"],
              ["e2l","e4r"],
    
              //radtube
              {"beamSpring":166830,"beamDamp":84},
              {"beamDeform":2025,"beamStrength":7000},
              ["e2r","ra1r"],
              ["e2l","ra1r"],
              ["e4r","ra1r"],
              ["e4l","ra1r"],
              {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
        ],
        "triangles": [
                ["id1:","id2:","id3:"],
                {"groundModel":"metal"},
                /*
                ["e5l", "e1l", "e3l"],
                ["e4r", "e3r", "e2r"],
                ["e3r", "e1r", "e2r"],
                ["e1r", "e1l", "e2r"],
                ["e2r", "e1l", "e2l"],
                ["e3l", "e1l", "e3r"],
                ["e3r", "e1l", "e1r"],
                ["e4r", "e4l", "e3l"],
                ["e4r", "e3l", "e3r"],
                ["e4r", "e2r", "e4l"],
                ["e4l", "e2r", "e2l"],
                ["e4l", "e2l", "e6l"],
                ["e6l", "e3l", "e4l"],
                ["e6l", "e2l", "e5l"],
                ["e6l", "e5l", "e3l"],
                ["e2l", "e1l", "e5l"],
                */
                {"triangleType":"NONCOLLIDABLE"},
                ["e2l", "e2r", "e1r"],
                ["e1r", "e1l", "e2l"],
                {"triangleType":"NORMALTYPE"},
        ],
    }


    Also, here's the mod's materials.cs file, which should be mapping the Barstow engine's texture files to the new 353 engine. This should be run in addition to the unmodified Hopper's materials.cs code, which will add textures to all the stock Hopper things.



    Code:
    singleton Material(barstow_engine)
    {
        mapTo = "barstow_engine";
        diffuseMap[0] = "vehicles/common/null.dds";
        specularMap[0] = "vehicles/common/null.dds";
        diffuseMap[1] = "vehicles/hopper/barstow_engine_v8_d.dds";
        normalMap[1] = "vehicles/hopper/barstow_engine_v8_n.dds";
        normalMap[0] = "vehicles/hopper/barstow_engine_v8_n.dds";
        specularMap[1] = "vehicles/hopper/barstow_engine_v8_s.dds";
        specularPower[0] = "128";
        pixelSpecular[0] = "1";
        specularPower[1] = "32";
        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 1 1 1";
        dynamicCubemap = true;
        materialTag0 = "djkontraktor"; materialTag1 = "vehicle";
    };

    All texture and DAE files I presume I need have been copied over into my mod's directory.
    barstow.cdae
    barstow.dae
    barstow_engine_v8_d.dds
    barstow_engine_v8_n.dds
    barstow_engine_v8_s.dds
    barstow_n.dds


    But for some reason, there is an error, probably a small one, that causes the game not to know where to find the 353 engine's textures. I suspect it is a class naming error somewhere, but I just don't know enough about the language to find it.


    Any help is greatly appreciated!
    -Will
     
  2. Deleted member 160369

    Deleted member 160369
    Expand Collapse
    Guest

    NO TEXTURE or NO MATERIAL?

    If the former, check for texture filepaths and filenames.

    If the latter, you should verify material names both in Blender and in your materials.cs file.
     
  3. djkontraktor

    djkontraktor
    Expand Collapse

    Joined:
    Jul 8, 2016
    Messages:
    12
    I'm just now downloading Blender. Seems the limit of what I can do without having to use a 3D modeling program has passed.
    --- Post updated ---
    Whoa. Blender is insanely complicated. This is gonna take a while. You could spend a whole college semester just learning the basics of Blender. All I want to do is find any materials I may have embedded in the .dae files, and either rename them or find out what they even are.

    It looks like probably a materials issue. Some reference to a material is wrong. Probably because I don’t know what goes where.

    I basically just copy-pasted the barstow’s materials names. Am I putting the in the wrong locations?
     
    #3 djkontraktor, Dec 28, 2017
    Last edited: Dec 28, 2017
  4. djkontraktor

    djkontraktor
    Expand Collapse

    Joined:
    Jul 8, 2016
    Messages:
    12
    SOLVED-
    Here's how I solved it:
    It was indeed a materials naming error. No Blender knowledge required. Whew!
    I just copied and pasted the materials names from the original Barstow file, and it worked. So those fields were for the materials names. Now I know.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice