1. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    Solutions and more information may already be available.

Part swap between vehicles, jbeam question

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by powerwindows83, Feb 16, 2019.

  1. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    ive read many forums about parts swapping between different vehicles, and a fairly common one is putting 4wd into vehicles not originally designed to have it. right now im trying to make the moonhawk 4wd.

    what i know: i copied the differential and driveshaft coding to the front suspension file and changed the names of all the parts to align with their respective axles. my first attempt is what most forums suggest is the end, when in fact its not: "copy diff code, change letters, good to go!" but this results in an awd car, not a 4x4 one. since the games answer to two diffs connected to the same drive node is an open center diff effect (in the moonhawk the trans output node is "tra1"). the side effect of this is that the wheels will sometimes blow up from overspeeding when the axle goes airborne and the center diff sends all the power in its direction. so my solution to this is send the trans output to a transfer case i swap in from the d-series/roamer, then connect the two separate driveshafts to their respective outputs.

    the game treats the front and rear driveshafts as the same beam according to the jbeam file, unless you create a new front driveshaft like i did. making them two separate beams makes the transfer case swap possible.

    what i dont know: how much i need to do in the way of creating a beam structure around the transfer case, or if it needs one at all.

    it appears the correct way to do this would be to define new beams between the output of the transfer case and the output of the transmission, but i dont know if that needs to be beefed up with triangles and all that jazz to handle torque, or if i can just direct connect the output of the current moonhawk transmissions ("tra1") to the input of the transfer case, then the same with the driveshafts, essentially leaving the case "floating" in the drivetrain.

    i also dont know if collision between the case and the floor is gonna be an issue or not, or if the case is even a physical part...?

    any deeper knowledge of jbeam structures is appreciated! learn something new every day!
     
  2. Ai'Torror

    Ai'Torror
    Expand Collapse

    Joined:
    Aug 29, 2015
    Messages:
    1,691
    Powertrain parts technically don't have to be jbeamed at all.

    Can we get a screenshot of the powertrain app with your 4wd system selected?
    My best guess is that you added a transfercase, but you didn't add new rear driveshaft to accomodate for different power input, or you just used an open diff instead of locked one in the transfercase code (if going for AWD LSD would be the best option).
     
  3. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    hey whats up man? :D

    what i do know:

    i realized my earlier question about building jbeam structures didnt really matter, and you just confirmed it. one less thing to worry about!

    so the car now recognizes the transfer case and its under the transmission in the parts tree. the drivetrain doesnt respond at all to the low range box or the 4wd selector, and the reason for that is the driveshafts are still connected to the trans output node. the transfer case just exists in the car and does nothing right now, which is still sorta forward progress from last night when it wasnt being listed.

    what i dont know:
    how the bloody driveshafts are supposed to connect to the transfer case, and how the case connects to the transmission. in the file attached to this i clipped the important pieces of code so you can see what i currently have. right now i still have the front and rear driveshafts both connecting to the transmission output node "tra1" which results in an open center diff and exploding wheels :p

    65 ["ax3","tra1", {"name":"driveshaft_F"
    94 ["ax3","tra1", {"name":"driveshaft_R"

    15 "gearboxNode:":["tra1"],


    56 ["driveshaft_F", "moonhawk_driveshaft_F", "ax3r" , "ax3l", "tra1"
    85 ["driveshaft_R", "moonhawk_driveshaft_R", "ax3r" , "ax3l", "tra1"


    whats confusing me is i cant find a definition of trans input and F/R outputs in the transfer case stuff

    22 "slotType" : "moonhawk_transfer_case",
    23 "controller": [
    24 ["fileName"],
    25 ["4wd", {"shaftName":"transfercase_F", "rangeBoxName":"rangebox"}],
    26 ],
    27 "powertrain" : [
    28 ["type", "name", "inputName", "inputIndex"]
    29 ["rangeBox", "rangebox", "gearbox", 1, {"gearRatios":[1,2.2], "uiName":"Rangebox"}]
    30 //locked center diff
    31 ["differential", "transfercase", "rangebox", 1, {"diffType":"locked", "lockTorque":10000, "friction":5, "uiName":"Transfer Case","defaultVirtualInertia":0.1}]
    32 //disconnecting front shaft
    33 ["shaft", "transfercase_F", "transfercase", 2, {"canDisconnect":true,"uiName":"Front Output Shaft"}],

    questions:
    it seems like theres a progression through the drivetrain components here (29 "rangebox", "gearbox" -- 31 "transfercase", "rangebox" --33 "transfercase_F", "transfercase") so is it just a plug and play by replacing "transfercase_F" with "driveshaft_F"? and how do i tell the driveshaft beam (56, 65) to connect to the transfer case instead of "tra1"?

    do i similarly replace "gearbox" (29) with "tra1"?

    where does the rear driveshaft connect? i assume it would be just above the disconnectable piece of the drivetrain, so probably "rangebox" ...again, how do i tell it to connect there (85, 94)?

    thanks my dude!
     

    Attached Files:

  4. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    2WD LAYOUT:

    upload_2019-2-16_16-3-39.png

    this setup, clearly, always remains RWD. the transfer case is recognized as an unused part of the drivetrain and has no effect on anything.

    4WD LAYOUT:

    upload_2019-2-16_16-5-5.png

    the transfer case is still recognized as an unused part, but even changing the variables i mentioned in my above comment and testing it results in no change at all. the app says the transfer case is connected via "driveshaft_F" to the front axle as it should be, but the rear output says "dummy_shaft_0" and the case itself isnt being driven by anything. putting the front diff in brings it back to the same open center diff state it was in before, despite the jbeam now saying both shafts are supposed to be attached to the outputs, and the "tra1" node is supposed to be driving the transfer case...

    i dunno!
     
  5. Ai'Torror

    Ai'Torror
    Expand Collapse

    Joined:
    Aug 29, 2015
    Messages:
    1,691
    Soo...
    Let's focus on the "powertrain" section.
    Let's go down the chain starting with the engine.
    The way it is set up currently it goes like so:


    As you can see, the transfercase is completely skipped, both of your driveshafts (which have torque reactors, but we can skip those for simplification sake).

    In this scenario torque gets effectively doubled as you don't have any torque splitting device between the trans and both driveshaft, so the game just takes the output of the trans and put the exact same torque further down the line, but since you have 2 driveshafts, the torque gets doubled (I know it doesn't make sense).

    So... We want to put the transfercase between the trans and both driveshafts, so simplified powertrain flow should look like so:
    Now, since your transfercase has a selectable 4WD (you can switch it to 2WD) and your driveshafts have torque reactors and with use of your specific powertrain component names the tree should look like so:
    So what you have to do now, is change the names of the powertrain devices to create a proper link between all of them, you do that by modifying the powertrain section (example from your front driveshaft):
    Code:
    "powertrain" : [
    46         ["type", "name", "inputName", "inputIndex"]
    47         //front driveshaft
    48         ["torsionReactor", "torsionReactorF", "gearbox", 1, {}]
    49         ["shaft", "driveshaft_F", "torsionReactorF", 1, {"breakTriggerBeam":"driveshaft_F", "uiName":"Front Driveshaft", "electricsName":"driveshaft_F", "friction":1}]
    50     ],
    
    As you can see the input for the torsionReactorF is set to "gearbox" which is incorrect...
    It should be set to transfercase_F instead:
    Code:
    "powertrain" : [
    46         ["type", "name", "inputName", "inputIndex"]
    47         //front driveshaft
    48         ["torsionReactor", "torsionReactorF", "transfercase_F", 1, {}]
    49         ["shaft", "driveshaft_F", "torsionReactorF", 1, {"breakTriggerBeam":"driveshaft_F", "uiName":"Front Driveshaft", "electricsName":"driveshaft_F", "friction":1}]
    50     ],
    


    I hope this sets you on the correct path, If you will have any more questions feel free to ask here.

    Good luck!
     
  6. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    thanks man, ill give that a try in a bit
     
  7. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    UPDATE:

    upload_2019-2-16_23-15-11.png

    the car stays in RWD always. the range box works now, but for whatever reason i cant get the torsion reactor to connect to the transfer case. it just always says dummy shaft. in the build in this image i tried to connect the transfer case directly to the front driveshaft to cut down variables (which youll see under "//disconnecting front shaft"), and it had no effect.

    getting there... just a little more help needed hopefully!
     

    Attached Files:

  8. Ai'Torror

    Ai'Torror
    Expand Collapse

    Joined:
    Aug 29, 2015
    Messages:
    1,691
    I don't see anything which could cause that in the file you've posted, but I noticed something else. Your rear driveshaft overwrites the base game one, it should be a separate part instead, I suggest adding something like _powerwindows or _pw to the end of each part name to avoid overwriting.
     
  9. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    okie dokie!

    boy, this is fun... stuff that shouldnt be broken is, and stuff that should be isnt... welcome to modding!
    --- Post updated ---
    so i need to change "moonhawk_driveshaft_R" or "driveshaft_R"? because originally it was just "driveshaft"....
     
  10. powerwindows83

    powerwindows83
    Expand Collapse

    Joined:
    Aug 1, 2016
    Messages:
    12
    i fixed it. i just had a bunch of stuff defined incorrectly in random places in the transmission file (unsurprisingly). i just copied the pickup transfer case code again and did a side by side comparison, and now its all set. thanks for the help!

    here it is if you want it. i previously made the suspension components 100x stronger (beamspring ans beamdamp values) just so youre aware of that
     

    Attached Files:

  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