Solved Questions about JBeam

Discussion in 'Mod Support' started by DapperDan, Apr 16, 2016.

  1. DapperDan

    DapperDan
    Expand Collapse

    Joined:
    May 2, 2015
    Messages:
    1,249
    questions
    how to code turbos properly
    how to make engines and code them properly
    how to code props
    how to properly model parts like bumpers spoilers, bodykits, etc
    how to set up exhaust smoke simulation for custom exhausts
    how to make custom dds maps and textures
    how to make a subslot for a part
    this is sort of a silly question, is it possible to code AirBag Suspension(bagged suspension)
    how to strengthen beams and such when beamstrength is FLT_MAX
    when porting engines from other cars, why does the transmission not "drive" like it does with the original car
     
    #1 DapperDan, Apr 16, 2016
    Last edited: Apr 16, 2016
  2. Neo

    Neo
    Expand Collapse

    Joined:
    Oct 31, 2015
    Messages:
    260
    like a normal car but you insert in your info.json by the "Type"-Element the "Type":"Prop"
    E.G.:
    {
    "Name":"Beispiel",
    "Author":"Neo",
    "Type":"Prop"
    }
    I hope I helped you at least a little bit :)
     
  3. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    If you look in the engine.jbeam of an existing car with a turbo (ETK800, Sunburst, 200BX, Covet) you will see sections with:
    Code:
    "turbocharger": {
            "wastegateStart":11.5,
            "wastegateLimit":12.5,
            "maxExhaustPower": 550,
            "backPressureCoef": 0.0000005,
            "pressureRatePSI": 30,
            "frictionCoef": 2.5,
            "inertia":0.30,
            "bovSoundVolumeCoef": 0.6,
            "bovSoundFileName": "TurboBovSound",
            "pressurePSI":[
                //turbineRPM, pressure(PSI)
                [0,         -1.5],
                [30000,     -1],
                [60000,     7],
                [90000,     10],
                [150000,    12],
                [200000,    14],
                [250000,    15],
            ],
            "engineDef":[
                //engineRPM, efficiency, exhaustFactor
                [0,     0.0,    0.0],
                [650,   0.75,   0.5],
                [1000,   1.0,   0.8],
                [1200,  0.95,   1.0],
                [2000,  0.62,    1.0],
                [2500,  0.48,    1.0],
                [3000,  0.46,    1.0],
                [4000,  0.43,    1.0],
                [5000,  0.38,    1.0],
                [6000,  0.25,    1.0],
                [7000,  0.3,    1.0],
            ],
        },
    
    You can copy this section into an engine part on your mod. The details on what each thing means, you will have to experiment with, because we don't have documentation ready for it yet, and you can see its a very in depth simulation.

    Sorry, these questions are too vague to answer properly... Consult the wiki and tutorials in the forums. We plan to do more tutorials in the future.

    First, your mod must have thermals enabled with the right settings in the engine file. See the tutorial or copy the properties from an official car.

    http://wiki.beamng.com/Engine_Thermal_Simulation

    To make the exhaust work you need a start node for the exhaust chain. Pick a node on the engine and add "isExhaust":true in line with it like so:

    Code:
    ["engine_front", -0.26, -1.56, 0.85, {"isExhaust":true}],
    
    This defines where the beam chain starts. Choose a node near the front of the engine.

    Now, you must define a continuous chain of beams from that starting node to the exhaust tip. For every beam in the chain, add "isExhaust":true in line with the beam like so:
    Code:
    ["engine_front","engine_rear", {"isExhaust":true}],
    ["engine_rear","exhaust_1", {"isExhaust":true}],
    
    If you are successful, the exhaust will come out the last node. If the chain is not connected all the way, the exhaust will come out where the break is.

    Add this to your part:
    Code:
    "slots": [
            ["type", "default", "description"]
            ["slot_type_1","part_x", "Subslot"],
     ],
    
    Then, create a new part. It will look like this:

    Code:
    "part_x": {
        "information":{
            "authors":"danielon398767",
            "name":"Part_X",
            "value":9000,
        }
        "slotType" : "slot_type_1",
    //the rest of the sections (nodes, beams, etc) go here
    },
    
    When you add a "slots" section, the game will look through all the jbeam files for the vehicle, and in common, to try to find a part with slot type that matches. It will install whatever part matches "default" in the slot definition, and allow you to select others using the part configurator.

    Certainly possible but I would consider it an advanced topic. There are many ways to go about it. You could create a cylinder in jbeam with collision/pressure triangles, and use our air pressure simulation. Or, you could add a "Pressured" beam. To control it in realtime may require lua scripting.

    The beamStrength of a beam is the force where it will break completely. The beamDeform controls how much force it takes to stretch/compress and not return. So, with beamDeform and beamStrength at FLT_MAX, the beam is completely invicible, will always spring back to the same size. A beam with low beamDeform and beamStrength at FLT_MAX can crush a lot (like our car bodies) but will never break completely. A beam with high or FLT_MAX beamDeform but low beamStrength will be brittle like glass. As soon as the force reaches the limit it will break, without a chance to bend at all.

    One possible reason: If you put a car with a lot of horsepower from a heavy car into a small car, the lighter nodes of the small cars suspension and tires cannot handle the forces as well, and it can become unstable. In the engine or transmission jbeam, try reducing the clutchTorque value. Try choosing heavier wheels. Or, increase the weight of the torque reaction nodes. You can see which nodes are used for torque reactions by looking at the wheel definition in the "wheeldata" part in the suspension jbeam.
    Code:
    ["FR", "wheel_FR", "tire_FR", "fw1rr", "fw1r", 9999,  "fh5r",{"nodeCoupling:":"fnc1r","torqueCoupling:":"ta1","torqueArm:":"tc1"}],
    
    The torqueCoupling and torqueArm nodes are the ones you might want to try increasing the weight of.

    Hope this was helpful!
     
    • Like Like x 2
  4. DapperDan

    DapperDan
    Expand Collapse

    Joined:
    May 2, 2015
    Messages:
    1,249
    thank you so much :p
     
  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