1920 Caravan Trailer (PROBLEM)

Discussion in 'Content Creation' started by acynder, Mar 8, 2021.

  1. acynder

    acynder
    Expand Collapse

    Joined:
    Mar 22, 2015
    Messages:
    226
    I have been trying to create a mod for a clasic trailer that you could find in any european ww2 theater, but I had encountered a problem trying to use the Node offset fuction to use the 5 Lug hub standard in my desing.
    This code is esentialy a re-sized pickup rear axle to fit my needs. Thank you for your help.
    Code:
    {
    //-----------------------------------
    //
    //        Rear Axle
    //
    //-----------------------------------
    //
        "rear_suspension":{
            "information":{
            "authors":"Acynder, All mighty BeamNG Devs",
            "name":"Rear Axle",
            "value":500,     
            },
            "slotType" : "crvn_rear_suspension",
            "slots":[
                ["type", "default", "description"],
                ["pickup_hub_R","pickup_hub_R_5","Rear Wheel Hubs", {"nodeOffset":{"x":0.60000, "y":-1.50300, "z":-0.50010}}],
                // "x":"$trackwidth_R", "y":-1.503, "z":-0.5001
            ],
            /*
            "variables": [
                ["name", "type", "unit", "category", "default", "min", "max", "title", "description"]
                ["$trackwidth_R", "range", "m", "Wheels", 0.41, 0.41, 5.544, "Rear Track Width", "Widen or narrow the wheel track"{"stepDis":0.005}]
            ],
            */
            "flexbodies": [
                ["mesh", "[group]:", "nonFlexMaterials"],
                //rear axle
                ["pickup_hub_R", ["wheelhub_RR", "wheelhub_RL", "pickup_axle_R", "pickup_rearshockbottom"],[],{"pos":{"x":0.0, "y":0.0, "z":0.0}}], //"y":-1.5, "z":-0.46
                //["pickup_axle_R", ["pickup_axle_R", "pickup_rearshockbottom", "pickup_engine"],[],{"pos":{"x":0.0, "y":0.0, "z":0.0}}],
            ],
            
            "nodes":[
                 ["id", "posX", "posY", "posZ"],
                
                 //--REAR LIVE AXLE SUSPENSION--
                 {"frictionCoef":0.5},
                 {"nodeMaterial":"|NM_METAL"},
                 {"nodeWeight":5.2},
                 {"collision":true},
                 {"group":"caravan_axle_R"},
                
                 {"selfCollision":false},
                 ["ax2r", -0.56275, -1.5, -0.27, {"group":["caravan_axle_R","caravan_leafbottom"]}],
                 ["ax2l", 0.56275, -1.5, -0.27, {"group":["caravan_axle_R","caravan_leafbottom"]}],
                
                 {"selfCollision":true},
                 ["ax3r", -0.64275, -1.31, -0.5],
                 ["ax3l", 0.64275, -1.31, -0.5],
                 ["ax4r", -0.64275, -1.67, -0.5],
                 ["ax4l", 0.64275, -1.67, -0.5],
                 //dif nodes
                 ["ax1", 0.0, -1.67, -0.5{"nodeWeight":15}],
                 ["ax3", 0.0, -1.31, -0.5{"nodeWeight":15,"selfCollision":false}],
                 ["ax2", 0.0, -1.5, -0.27{"nodeWeight":10,"selfCollision":false}],
                 {"nodeWeight":5.2},
                
                 //can be overwritten by offroad leaf spring
                 ["axsr", -0.56275, -1.5, -0.46{"group":["caravan_axle_R","caravan_leafbottom"]}],
                 ["axsl", 0.56275, -1.5, -0.46{"group":["caravan_axle_R","caravan_leafbottom"]}],
                 //--
                
                 {"group":"pickup_rearshockbottom"},
                 {"nodeWeight":6.0},
                
                 //shock mounting nodes
                 ["axshr", -0.24275, -1.57, -0.54],
                 ["axshl", 0.24275, -1.57, -0.54],
                 {"group":""},
                 //BNEnodes
      
            ],
            "beams":[
                ["id1:", "id2:"],
                    
                  //live axle suspension
                  {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
                  {"beamSpring":12001000,"beamDamp":150},
                  {"beamDeform":60000,"beamStrength":621000},
                  ["ax2","ax2r"],
                  ["ax2","ax2l"],
                  ["ax3","ax3r"],
                  ["ax3","ax3l"],
                  ["ax1","ax4r"],
                  ["ax1","ax4l"],
                  //
                  ["ax2l","ax3l"],
                  ["ax2r","ax3r"],
                  ["ax4l","ax3l"],
                  ["ax4r","ax3r"],
                  ["ax4l","ax2l"],
                  ["ax4r","ax2r"],
                  ["ax1","ax2"],
                  ["ax1","ax3"],
                  ["ax2","ax3"],
    
                  //crossing
                  ["ax2r","ax1"],
                  ["ax2l","ax1"],
                  ["ax3r","ax1"],
                  ["ax3l","ax1"],
                  ["ax3r","ax2"],
                  ["ax3l","ax2"],
                  ["ax4r","ax2"],
                  ["ax4l","ax2"],
                  ["ax2r","ax3"],
                  ["ax2l","ax3"],
                  ["ax4r","ax3"],
                  ["ax4l","ax3"],
    
                  ["ax2l","ax2r"],
                  ["ax3l","ax3r"],
                  ["ax4l","ax4r"],
    
                  //wheel to axle
                  {"optional":true},
                  {"beamSpring":7001000,"beamDamp":150},
                  {"beamDeform":110000,"beamStrength":360000},
                  {"breakGroup":"wheel_RR"},
                  ["rw1rr","ax2r"],
                  ["rw1rr","ax3r"],
                  ["rw1rr","ax4r"],
                  ["rw1r","ax3"],
                  ["rw1r","ax2"],
                  ["rw1r","ax1", {"name":"axle_RR"}],
                  ["rw1r","ax2r"],
                  ["rw1r","ax3r"],
                  ["rw1r","ax4r"],
                  {"breakGroup":"wheel_RL"},
                  ["rw1ll","ax2l"],
                  ["rw1ll","ax3l"],
                  ["rw1ll","ax4l"],
                  ["rw1l","ax3"],
                  ["rw1l","ax2"],
                  ["rw1l","ax1", {"name":"axle_RL"}],
                  ["rw1l","ax2l"],
                  ["rw1l","ax3l"],
                  ["rw1l","ax4l"],
                  {"optional":false},
                  //shock mounts
                  {"breakGroup":""},
                  {"beamSpring":3001000,"beamDamp":150},
                  {"beamDeform":60000,"beamStrength":"FLT_MAX"},
                  ["axshr","ax2r"],
                  ["axshr","ax3r"],
                  ["axshr","ax4r"],
                  ["axshr","ax1"],
                  ["axshr","ax2"],
                  ["axshr","ax3"],
                  ["axshl","ax2l"],
                  ["axshl","ax3l"],
                  ["axshl","ax4l"],
                  ["axshl","ax1"],
                  ["axshl","ax2"],
                  ["axshl","ax3"],
                  //spring mounts
                  {"beamSpring":6001000,"beamDamp":150},
                  ["axsl","ax2l"],
                  ["axsl","ax3l"],
                  ["axsl","ax4l"],
                  ["axsl","ax1"],
                  ["axsl","ax2"],
                  ["axsl","ax3"],
    
                  ["axsr","ax2r"],
                  ["axsr","ax3r"],
                  ["axsr","ax4r"],
                  ["axsr","ax1"],
                  ["axsr","ax2"],
                  ["axsr","ax3"],
    
    /*             
                  //rear limiters
                  {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":0.45, "beamShortBound":0.45},
                  {"beamSpring":0,"beamDamp":0,"beamDeform":75000,"beamStrength":231000},
                  {"beamLimitSpring":5001000,"beamLimitDamp":2500},
                  //["ax1","fr17"],
                  {"optional":true},
                  {"breakGroupType":1}
                  {"beamLongBound":0.145, "beamShortBound":0.145},
                  {"breakGroup":"wheel_RR"},
                  ["rw1r","fr17"],
                  {"breakGroup":"wheel_RL"},
                  ["rw1l","fr17"],
                  {"breakGroup":""},
                  {"beamLongBound":0.4, "beamShortBound":0.2},
                  {"breakGroup":"wheel_RR"},
                  ["rw1r","fr14l"],
                  {"breakGroup":"wheel_RL"},
                  ["rw1l","fr14r"],
                  {"breakGroup":""},
                  {"optional":false},
                  ["ax2r","fr14l"],
                  ["ax2l","fr14r"],
                  //bed
                  {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":0.48, "beamShortBound":0.28},
                  {"breakGroup":"wheel_RR"},
                  {"optional":true}
                  ["rw1rr","b14rr"],
                  ["rw1rr","b10rr"],
                  ["rw1r","b14rr"],
                  ["rw1r","b10rr"],
                  {"breakGroup":"wheel_RL"},
                  ["rw1l","b14ll"],
                  ["rw1l","b10ll"],
                  ["rw1ll","b14ll"],
                  ["rw1ll","b10ll"],
                  {"optional":false}
                  {"breakGroupType":0}
                  {"breakGroup":""},
                  {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":0.48, "beamShortBound":0.28},
                  //rear limiters
                  {"beamLongBound":0.35, "beamShortBound":0.15},
                  ["axshr","fr17"],
                  ["axshl","fr17"],
                  //["ax1","fr17"],
                  {"beamLongBound":0.145, "beamShortBound":0.145},
                  ["ax2r","fr17"],
                  ["ax2l","fr17"],
                  ["ax2","fr17r"],
                  ["ax2","fr17l"],
                  {"beamLongBound":0.4, "beamShortBound":0.2},
                  ["ax2r","fr14l"],
                  ["ax2l","fr14r"],
                  //rear limiters
                  {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":0.48, "beamShortBound":0.28},
                  ["ax1","fr19r"],
                  ["ax1","fr20r"],
                  ["ax1","fr19l"],
                  ["ax1","fr20l"],
                  ["ax2","fr19r"],
                  ["ax2","fr20r"],
                  ["ax2","fr19l"],
                  ["ax2","fr20l"],
                  {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
                  {"beamSpring":0,"beamDamp":2500},
                  {"beamDeform":30000,"beamStrength":50000},
                  //pinion damper
                  ["ax2","fr10"],
                  ["ax1","fr10"],
                  //hard limit
                  {"beamSpring":2001000,"beamDamp":2000,"beamDeform":86750,"beamStrength":126330},
                  {"beamPrecompression":0.75, "beamType":"|SUPPORT", "beamLongBound":4},
                  ["axshr","fr17r"],
                  ["axshl","fr17l"],
                  {"breakGroupType":0},
                  {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
    */
                //BNEbeams
      
      
            ],
            "triangles":[
                ["id1:", "id2:", "id3:"],
                //axle shape
                {"triangleType":"NONCOLLIDABLE"},
                ["ax1", "ax3", "axshr"],
                ["axshr", "ax3r", "axsr"],
                ["axsr", "ax4r", "axshr"],
                ["ax4r", "ax1", "axshr"],
                ["ax3", "ax3r", "axshr"],
                ["ax3r", "ax4r", "axsr"],
                ["ax4r", "ax3r", "ax2r"],
    
                ["ax3", "ax1", "axshl"],
                ["ax3l","axshl", "axsl"],
                ["ax4l", "axsl", "axshl"],
                ["ax1", "ax4l", "axshl"],
                ["ax3l", "ax3", "axshl"],
                ["ax4l", "ax3l", "axsl"],
                ["ax3l", "ax4l", "ax2l"],
                {"triangleType":"NORMALTYPE"},
    
                //BNEtriangles
      
      
            ],
            "pressureWheels": [
                ["name","hubGroup","group","node1:","node2:","nodeS","nodeArm:","wheelDir"],
                //cancel out brake properties
                {"brakeTorque":0},
                {"parkingTorque":0},
                {"enableBrakeThermals":false},
                {"brakeDiameter":false},
                {"brakeMass":false},
                {"brakeType":false},
                {"rotorMaterial":false},
                {"brakeVentingCoef":false},
            ],
       }
    }
     

    Attached Files:

  2. TechMechanic

    TechMechanic
    Expand Collapse

    Joined:
    Nov 22, 2017
    Messages:
    595
    What exactly is the problem? The nodeoffset appears to work fine as it is, however you wont spawn the pickup hubs without having a copy of the hub code in your mod.
     
  3. acynder

    acynder
    Expand Collapse

    Joined:
    Mar 22, 2015
    Messages:
    226
    The pickup hubs are in the common folder, they are a shared part so any vehicle should be able to use them. I literaly copy pasted the pickup rear axle and modified the nodes cordinates to fit my mod
    the problem is that when the vehicle spawns, the hubs spawn at x:0 y:0 z:0 offset
    upload_2021-3-8_22-3-39.png
     
  4. TechMechanic

    TechMechanic
    Expand Collapse

    Joined:
    Nov 22, 2017
    Messages:
    595
    All I could suggest right now is that you make your own copy of the hub code and rename it so that you can remove some of the offsets for the brakes and such to avoid any overlap, i'll check your code again later in beam and see if there are any overlapping offsets causing problems.
     
  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