Unsolved Help needed!

Discussion in 'Mod Support' started by The Boss Of Apex Motor Vehicles, Apr 18, 2021.

  1. The Boss Of Apex Motor Vehicles

    Joined:
    Mar 3, 2018
    Messages:
    92
    Hi there, I am working on a new Minivan mod for BeamNG, it is an Automation mod, but will be redone, similar to the Gavril Vertex NA2. I am new to modding, and need help with the Jbeam. Can someone help me with this?
     
  2. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    What part/parts of it?
     
  3. The Boss Of Apex Motor Vehicles

    Joined:
    Mar 3, 2018
    Messages:
    92
    The whole thing would be nice, I am very new to modding, and all I have done is automation. I can pay money if necessary
     
  4. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    Code:
    {
    "name_of_thing": {
        "information":{
            "authors":"your_name",
            "name":"Name of thing in ui",
        },
        "slotType" : "name_of_slot",
        "slots": [
            ["type", "default", "description"],
            //bodywork
            ["other_slot","other_slot", "Other Slot"],
        ],
    },
    }
    Starting your jbeam
    You always have to start with a { at the top. On the second line (always is in speech marks) is the name of your thing in the code. For example, "citybus_engine". Next is always the information. I don't think I need to explain what the "authors" sections means ;). The "name" part is what your thing will be called in the parts selector.
    "SlotType" is quite obvious and is the name of the slot your thing goes into. For example, "pigeon_engine_600" could go in the slot "pigeon_engine" meaning you would put "pigeon_engine" as the slotType. "slots" is where you list slots where you can put other things. For example, semi_engine could have a slot for semi_turbo.The "type" part is the name of your slot, the "default" part is the name of the default thing that goes in that slot and the "description" part is a very brief description of what it is that goes in the slot (this will appear next to the slot in the parts selector). The "slots" section is optional if the part doesn't have any slots. The ending of you section (in this case the section is "slots") is determined by whether it was a [ or a { at the start. In this case, it is "slots": [ which means it would end in ],. If it started with a { it would end in },.

    Nodes
    Code:
        "nodes" :[
             ["id", "posX", "posY", "posZ"],
             {"group":"thing"},
             {"selfCollision":false}
             {"collision" :true}
             {"nodeMaterial":"|NM_METAL"},
             {"frictionCoef":0.7},
             {"nodeWeight":3},
             ["node1", 0, -2.17, -0.66],
             {"group":""}, 
        ],
    Nodes are like little dots/vertices that determine the weight and positioning of things. This a simple nodes section. To start things off, I'm going to talk about the axis. The X axis is left and right (you add to go left), the Y axis is forwards and backwards (add to go backwards) and the Z axis is up and down (add to go up). The "group" part is the name of your group of nodes where a flexbody can be put (I don't know whether you need flexbodies or not). I'm not entirely sure what SelfCollision and Collision are for but I'm guessing they do wat they say on the tin. "nodeMaterial" is what material your nodes are made from. There are many materials to chose from including wood and plastic. "frictionCoef" is (I'm pretty sure) how much friction it makes when it touches the ground. "nodeWeight" is how much the node weighs in kg. Onto making the actual nodes now. the first part is the "id" section which is the name of your node. Second, third and fourth are the position of the node on the X, Y and Z axis. the {"group":""}, part at the bottom is tell beamng that the group we mentioned before as ended. If the nodes section has more than one group, you don't need to end the first group with {"group":""}, and then start the next one just start the next one like this:
    Code:
             {"group":"thing"},
             {"selfCollision":false}
             {"collision" :true}
             {"nodeMaterial":"|NM_METAL"},
             {"frictionCoef":0.7},
             {"nodeWeight":3},
             ["node1", 0, -2.17, -0.66],
             {"group":"thing2"},
             ["node2" 0, -2.76, -0.36],
             {"group":""},
    Beams
    Code:
              "beams": [
              ["id1:", "id2:"],
              {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
              {"beamSpring":130100,"beamDamp":50},
              {"beamDeform":448000,"beamStrength":779879"},
              {"deformLimitExpansion":1.1},
              ["thing", "thing2"],
        ],
    Beams are things that connect nodes together and make the structure and strenth of your object. "beamPrecompression" is the length of you beam. If it is set to 1 it will be at its default length, if it's set to 2 it will be double its original length. You can check the wiki for more info on the "beamType", "BeamLongBound" and "BeamShortBound" sections. "BeamSpring" is how stiff/ springy the beam is. "BeamDamp" is how much energy is disipated when under stress. "BeamDeform" is how much pressure it takes to deform the beam. The higher the value, the more stress it can withstand before it deforms. "BeamStrenth" is how much pressure it takes to break the beam. The higher the value, the more pressure it takes to break it. I'm not sure what "DeformLimitExpansion" does but you don't need it. When making beams the "id1" is the first node in the beam and "id2" is the second node. In this example, the first node is thing which connects to thing2.

    Stuff I Forgot to Mention
    If you want to put in text without it being read by beamng you can simply put a // next to it, this means that beamng will skip that section. I ofte use this to make notes as to what things are (like in the first code example where I had //bodywork.

    Ending your jbeam
    When ending your jbeam, you have to first end your segment with either ], or }, then put a
    },
    }
    Make sure your }, } is against the edge of the page like in the first code example.

    If you need any other things explaining like triangles, flexbodies etc. Please tell me and I can. Sorry if I made some typos, I do that a lot. :D
     
    #4 TC203, Apr 19, 2021
    Last edited: Jan 16, 2022
    • Like Like x 3
  5. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,062
    Wow that's a great explanation! Also, DeformLimitExpansion is basically what it says in the name, so how much the beam can deform in expansion, for example if it's 2 then it can only deform up to 2 times of its original length (it's usually a much smaller value, like 1.1 or 1.05, on very small objects you can use 1.01 or even 1.001 but you shouldn't make stuff so small unless there's no other way). You shouldn't change this unless you are working on very small objects (for example in my case I used it for fingers of a crash test dummy because they are so close together).
     
  6. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    Thanks, that took me ages to type lol
     
  7. The Boss Of Apex Motor Vehicles

    Joined:
    Mar 3, 2018
    Messages:
    92
    Thank you for helping explain that to me! I am barely able to understand code, but this was quite helpful.
     
  8. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    You're welcome :)
     
  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