Solved Powertrain problem: can't change gear at all

Discussion in 'Mod Support' started by Tango91, May 5, 2020.

Tags:
  1. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    Howdy,
    Hoping someone can point me in the right direction, I've been pulling my hair out for literally hours, over the powertrain in a mobile crane I'm building from scratch.

    It just won't change gear, regardless of whether I put in a manual 'box with a normal clutch, or an auto 'box with a torque converter. Pressing the up or down shift buttons or keys does absolutely nothing.
    • Other mods and stock vehicles shift just fine
    • The engine starts, stops and revs as you would expect
    • the powertrain works otherwise, I can set the 'neutral' gear ratio on the auto box to a positive number and off it goes, behaving as if it were in gear. (but obviously can't be shifted at all)
    • with a manual I can't actuate the clutch at all and the UI widget shows it at 100% pushed constantly.
    • The powertrain UI widget shows I have everything laid out fine.
    • The debug terminal shows no errors
    • Neither gamepad or keyboard input will make it shift.

    I hope I'm just doing something stupid and I've overlooked something. I've been through the whole of the powertrain code a dozen times looking for a problem. I've made other mods that work nicely, and even copying the component parts across directly doesn't help.

    I've got this, as you would expect, in the main vehicle jbeam:

    Code:
    "controller": [
        ["fileName"],
        ["vehicleController", {}],
    ],
    The powertrain widget:



    and the individual components that make up the powertrain go on to add their own properties to vehicleController.

    I hope someone has had a similar issue and can point me in the right direction. I've searched the forums but the only posts I've found that were relevent didn't include enough information to be helpful.

    Thanks!
     
  2. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Have you tried to invert your controller axis ?
     
  3. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    Thanks, but the controller assignments aren't the problem, it works perfectly with every other vehicle.

    There must be something I'm missing that's causing the game's Powertrain logic to fall over.
     
  4. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    It's just a guess but if the console prints no errors after you pressed one of the shift buttons then I would believe that the gearbox isn't properly recognized by the shift logic at all. Maybe check again for naming typos and double check the input values between clutch and gearbox ?
     
  5. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    Yeah, that's what I'm hoping, But for the life of me I can't get the damn thing to play ball no matter what sort of fransmission i use.

    The powertrain widget shows everything connected up in the right hierarchy AFAIK, and the crane can move if you change the neutral gear ratio to something other than zero, and it acts properly, the toque converter creeps it forwards unless you put the brakes on, etc.

    I just can't shift between gears! It's really frustrating because other than that it's working fine :mad:
     
  6. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    I recently got involved working on a similar problem but here a complete double drive train is involved. Why would a single drive train cause such a problem ? It should work right 'out of the box', no ? the functions shiftUp() (and down and shiftToGearIndex) are 'ordered' by the vehicleController and find their way to the shift logic lua, the shift logic then applies to the gearbox lua in question. If you have no errors in
    the console then I don't think the shift functions apply.

    Did you edit vehicleController or shiftLogic ? Perhaps you left a "vehicleController" section out in one of the jbeam files were it would be needed? I'm just making suggestions.
     
  7. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    No, nothing advanced here. Thanks for your help btw

    I've got all the vehicleController sections in the engine/gearbox sections stripped down to the bare minimum but even the defaults don't let me shift. I've gone as far as to remove the lot then add a powertrain from a known working project... no dice.
     
  8. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    That's ok, I'm interested in this stuff :)

    Is this a stock (vanilla) setup ?
     
  9. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    Yup, It started as a blank file, it's still a heavy duty chassis with 2 axles under it at the moment. The most complicated thing is probably the suspension hydros. The rest is just all N&B geometry.

    I wonder what the most minimal powertrain setup I can put in it would be?

    Here's the real thing, I'm lucky enough to get to drive/operate it from time to time. Was supposed to be going through my LGV test just as this lockdown kicked in... :/



    Gotta scratch that crane itch somehow lol
     
  10. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hah, nice, I've operated (not driven) some like that occasionally in the past. :) I had my crane initiation with a tower crane coarse I finished shortly after leaving school (back in the days). This one seems like a 20-tonner or so from first glance :)

    Anyway,
    I guess just 4wd ? I mean for testing purpose you can just limit it to RWD ? It only has four wheels so it can use the simplest drive train setup imo.

    Hey wait, you started a blank file ? Is it possible that a gear node assignment might be missing somewhere? "tra1"
     
  11. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    This is purely RWD until I can get the damn thing to work, yeah. About as basic as I can get it:
    Engine>torqueConverter>autoGearbox>shaft>rear diff>2x shafts to wheels.

    I do have "gearboxNode" assigned in both the auto and manual gearboxes, just to one of the back lower nodes on the simple 'engine block' cube though. The wiki pages and documentation leave quite a bit to figure out through reverse engineering!

    https://documentation.beamng.com/vehicle_system/stockPowertrain/automaticGearbox.html
    This just says it's for the purposes of emitting noise?

    The crane in the photo is a 40 ton Terex AC40/2L.

    I initially started in Unity and/or Unreal, thinking that it'd be cool to drive in VR.
    I've got working concepts in both but you have to compromise on physics because of the size and weight, either you get a rigid and wooden facsimile or you get a collapsed pile of joints.



    Even the new betas of Unity with the new PhysX implementations of ArticulatedBody can't hack the numbers.
    I can get it to do this fine but as soon as you put any weight on the hook it opvercomes the linear motors that extend the boom sections and it all telescopes back into itself.

    Kind of annoying as i wasted dozens of hours writing classes and functions from scratch, but here we are.

    I enjoy the cranes you can get in RoR but that's getting a bit long in the tooth now.
     
    • Like Like x 1
  12. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Wow that is cool ! Alright, if you want to me to try out your current setup on my end you're welcome to send it through pm.
     
  13. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    PM sent :)
     
  14. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Alright I'll check it out :p
    --- Post updated ---
    I already found a bunch of typos (actually the wrong use of personal naming of the components) and I even haven't installed the mod yet.

    Hey there's a dog in the ref folder, cute :p

    Anyway, I'll be back in an hour or so :)
    --- Post updated ---
    Woops that went faster than I expected ! Fixed your 2 trannies, sir !



    Lovely mod ! I guess you will have to tune the ratios still, but you know that of course.

    Love the dog ! :p
     
    • Like Like x 1
  15. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    Thank you so much :) now I can get on with actually building the damn thing instead of bashing my head against one little bit.
     
  16. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    You're welcome, by your explanation in the beginning of the thread I knew this had to be a minute problem.

    Your mod is lovely so far, suspension works and everything, cool :)
     
    • Like Like x 1
  17. Tango91

    Tango91
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    68
    For anyone viewing this thread in the future, in hope of fixing a similar problem/playing along at home:

    The problem was that I hadn't properly named the powertrain components and it upset the vehicleController.




    As an example, this is part of what I had before:

    Code:
    "AutoGearboxStd": {
       
            "information":{
                "authors":"Tango91",
                "name":"6 Speed Auto Gearbox",
                "value":1000
            }
           
            "slotType"    :    "craneGearbox",
           
            "powertrain": [
                ["type",             "name",              "inputName",            "inputIndex"]
                ["torqueConverter",  "torqueConverterP",     "mainEngine",        1           ]          
                ["automaticGearbox", "autoGearbox",         "torqueConverterP", 1           ]          
                ["shaft",            "rearDriveshaft",      "autoGearbox",         1           ]
            ],
           
            "torqueConverterP": {
                "uiName":"Torque Converter",
                "additionalEngineInertia":0.75,
                "converterDiameter":0.47,
                "converterStiffness":20,
                "couplingAVRatio":0.91,
                "stallTorqueRatio":1.85,
                "lockupClutchTorque":2700,
            },
    
            "vehicleController": {
            },
           
            "autoGearbox": {
                "uiName":"6Spd Auto Gearbox",
                "gearRatios":[, -5.55, -2.5, 1, 4.70, 2.21, 1.53, 1.00, 0.76, 0.67],
                "friction": 35,
                "gearboxNode:":["eng_RLB"],
                "parkLockTorque":1000,
            }, 
        }
    



    Whereas this is properly named thanks to NOCARGO

    Code:
    "AutoGearboxStd": {
       
            "information":{
                "authors":"Tango91",
                "name":"6 Speed Auto Gearbox",
                "value":1000
            }
           
            "slotType"    :    "craneGearbox",
           
            "powertrain": [
                ["type",             "name",              "inputName",            "inputIndex"]
                ["torqueConverter",  "torqueConverter",     "mainEngine",        1           ]          
                ["automaticGearbox", "gearbox",         "torqueConverter", 1           ]          
                ["shaft",            "rearDriveshaft",      "gearbox",         1           ]
            ],
           
            "torqueConverter": {
                "uiName":"Torque Converter",
                "additionalEngineInertia":0.75,
                "converterDiameter":0.47,
                "converterStiffness":20,
                "couplingAVRatio":0.91,
                "stallTorqueRatio":1.85,
                "lockupClutchTorque":2700,
            },
    
            "vehicleController": {
            },
           
            "gearbox": {
                "uiName":"6Spd Auto Gearbox",
                "gearRatios":[, -5.55, 0, 1, 4.70, 2.21, 1.53, 1.00, 0.76, 0.67],
                "friction": 35,
                "gearboxNode:":["eng_RLB"],
                "parkLockTorque":1000,
            },
    }
    

    Hopefully this helps someone one day.
    Thanks to NOCARGO! :)
     
    • Like Like x 1
  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