Adding an engine

Discussion in 'Content Creation' started by triumph1200, Oct 8, 2019.

  1. triumph1200

    triumph1200
    Expand Collapse

    Joined:
    Sep 7, 2019
    Messages:
    39
    I am trying to add an engine and have the following code and result (image below).

    Main jbeam file:
    Code:
        "slots": [
            ["type", "default", "description"]
            ["beamng_engine","beamng_engine","Example Car Engine"],
        ],
    Engine jbeam file:
    Code:
    {
    "beamng_engine": {
        "information":{
            "authors":"DrowsSam",
            "name":"Example Car Engine",
        }
        "slotType" : "beamng_engine",
        "scalebeamSpring":1,
        "scalebeamDamp":1,
        "scalebeamDeform":1,
        "scalebeamStrength":1,
        "slots": [
            ["type", "default", "description"]
            ["beamng_transmission","beamng_transmission", "Example Car Transmission"],
        ],
        "flexbodies": [
             ["mesh", "[group]:", "nonFlexMaterials"],
    
        ],
        "props": [
            ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"]
    
         ],
        "enginetorque":[
            ["rpm", "torque"]
            [0, 0],
            [500, 60],
            [1000, 73],
            [2000, 93],
            [3000, 115],
            [4000, 132],
            [4500, 134],
            [5000, 135],
            [6000, 134],
            [7000, 114],
            [7500, 90],
        ],
        "engine":{
            "idleRPM":1000, //Idling RPM
            "shiftDownRPM":3400, //Downshift, for automatic
            "shiftUpRPM":6400, //Upshift, for automatic
            "maxRPM":7500, //Maximum RPM for the engine (redline)
            "inertia":0.08,
            "friction":16,
            "brakingCoefRPS":0.15
            "burnEfficiency":0.5
            "throttleSensitivity":1.2
            },
        "nodes": [
             ["id", "posX", "posY", "posZ"],
    
             {"group":""},
            
        ],
        
        "beams": [
              ["id1:", "id2:"],
              {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
                        
              {"beamSpring":4001000,"beamDamp":150},
              {"beamDeform":1500000,"beamStrength":"FLT_MAX"},
    
              {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
        ],
        "triangles": [
                ["id1:","id2:","id3:"],
        ],
    }
    "beamng_transmission": {
        "information":{
            "authors":"DrowsSam",
            "name":"Example Car Transmission",
        }
        "slotType" : "beamng_transmission",
        "scalebeamSpring":1,
        "scalebeamDamp":1,
        "scalebeamDeform":1,
        "scalebeamStrength":1,
        "flexbodies": [
             ["mesh", "[group]:", "nonFlexMaterials"],
    
    
        ],
        "engine":{
            "transmissionType":"manual", //Automatic or manual; the automatic setting will restrict the use of manual mode while playing
            "lowShiftDownRPM":1400,
            "lowShiftUpRPM":3600,
            "highShiftDownRPM":3300,
            "highShiftUpRPM":6000,
            // -1, 0 (neutral), 1, etc
            "gears":[-2.9, 0, 26.5, 13.25, 8.82, 6.625] //Gear ratios
            "clutchDuration":0.25
            "viscousCoupling":3.5
            "lockingTorqueLimit":150
            "enableLocking":true
            },
        "nodes": [
             ["id", "posX", "posY", "posZ"],     
        ],
        
        "beams": [
              ["id1:", "id2:"],
              {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
                        
              {"beamSpring":4001000,"beamDamp":150},
              {"beamDeform":1500000,"beamStrength":"FLT_MAX"},
    
              {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
        ],
        "triangles": [
                ["id1:","id2:","id3:"],
        ],
    }
    }
    This was copied from an existing vehicle and the result I get is below image and no forward or reverse movement and a missing start button.

    Any help greatly appreciated.
     

    Attached Files:

    • beamng_rev.png
    • Like Like x 1
  2. Alex_Farmer557

    Alex_Farmer557
    Expand Collapse

    Joined:
    Dec 28, 2016
    Messages:
    3,541
    that's a very outdated jbeam
     
    • Informative Informative x 1
  3. Nicelittle

    Nicelittle
    Expand Collapse

    Joined:
    Apr 27, 2017
    Messages:
    772
    Your going to need a torque curve for it to work
     
  4. acynder

    acynder
    Expand Collapse

    Joined:
    Mar 22, 2015
    Messages:
    231
    Like already mencioned, this jbeam is really old and it probably only run on compatibily mode if at all. I recomend you to copy-pase the covet or the pigeon from the game files and disect It carefully. Reverse engineering the devs work is a really good way to learn how things work, since many parts of the wiki are obsolete (The last time I cheked it, I may be wrong) or undocumented.
     
    • Agree Agree x 1
  5. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    Agreed, that Jbeam is very very old, and probably won't work at all. The wiki documentation on engines and drivetrains is more or less accurate though, I updated it myself about 6 months ago. Try copying the engine from a car in game, and then use the wiki as reference.
     
    • Agree Agree x 2
  6. triumph1200

    triumph1200
    Expand Collapse

    Joined:
    Sep 7, 2019
    Messages:
    39
    Thanks for the reply. Copied several engines over but still doesn't rev or move. I have an engine, transmission, chassis and wheels (I even tried an electric motor). Do I need a driveshaft? I searched google and the wiki but cannot find any manuals or workflows for adding a drivetrain. Do you have a link?
     
  7. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    What does the console (`) say? Usually it'll tell you what's wrong.
     
    • Agree Agree x 1
  8. triumph1200

    triumph1200
    Expand Collapse

    Joined:
    Sep 7, 2019
    Messages:
    39
    Thanks for the reply. What do you mean by "console" ?
     
  9. acynder

    acynder
    Expand Collapse

    Joined:
    Mar 22, 2015
    Messages:
    231
    Did you code de controller?
    Code:
        "controller": [
            ["fileName"],
            ["vehicleController", {}],
        ],
    If it doesn't do nothing either you have a sintax error (The debug console will say "what" and most importantly were) or your vehicle doesn't have controler (I think, its just a guest)
     
    #9 acynder, Oct 9, 2019
    Last edited: Oct 9, 2019
  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