1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

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

Why do 4wd vehicles now spawn in 2wd?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by securiteeboyz, Jan 7, 2023.

  1. securiteeboyz

    securiteeboyz
    Expand Collapse

    Joined:
    Aug 2, 2016
    Messages:
    17
    Hello I really hate that 4wd vehicles spawn in 2wd, a lot of my mods need this 4wd on by default for the AI or I have to manually change it. Is there an option I'm missing? Is there anything in the game files I can change to set it back to 4wd default?
     
  2. Jackets64

    Jackets64
    Expand Collapse

    Joined:
    Nov 26, 2017
    Messages:
    1,911
    I'm unaware whether there is any particular way to enable 4WD automatically when spawned but the spawning in 2WD was a choice by the devs to make things more realistic. Notice how you can't put most vehicles in 2WD Low anymore.
     
  3. driftingmedic

    driftingmedic
    Expand Collapse

    Joined:
    May 17, 2020
    Messages:
    130
    I believe crawler transfer cases spawn 4wd default, unless you are spawning random vehicles, as long as you equip something with a crawler transfer case you will spawn in 4wd
     
    • Agree Agree x 1
  4. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    The cars now spawn in their "natural" setting ie what they would be most used for in IRL.
     
    • Agree Agree x 7
  5. gigisfan

    gigisfan
    Expand Collapse

    Joined:
    Aug 17, 2013
    Messages:
    101
    I have two related questions:

    1) why vehicles whom I added the 4wd system continue to spawn in 4wd? there is a line to add to jbeam?

    2) how I decide if my vehicle should have the separated 4wd/low range system (as the Stambecco has) or the more modern one?

    Thanks
    David
     
  6. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,414
    If you want to spawn in 2WD and have the new system, you need to update the whole transfer case code. For example:
    Old:
    Code:
        "controller": [
            ["fileName"],
            ["4wd", {"shaftName":"transfercase_F", "rangeBoxName":"rangebox"}],
        ],
        "powertrain" : [
            ["type", "name", "inputName", "inputIndex"],
            ["rangeBox", "rangebox", "gearbox", 1, {"gearRatios":[1,4], "uiName":"Rangebox"}],
        ],
        "gearbox": {
            "uiName":"Gearbox",
            //added stabilization for one way clutch with ultra low range
            "oneWayViscousCoef":20,
            "oneWayViscousSmoothing":100,
        },
        "torqueConverter": {
            "uiName":"Torque Converter",
            //added stabilization for torque converter with ultra low range
            "kFactorSmoothing":250,
        },
    
    New:
    Code:
        "controller": [
            ["fileName"],
            ["driveModes", {"name":"transfercaseControl"}]
            ["4wd", {"driveModesTransfercaseNames":["transfercaseControl"]}]
        ],
        "transfercaseControl":{
            "uiName": "Transfercase"
            "quickAccessTitle":"Transfercase"
            "quickAccessIcon":"radial_highrangebox"
            "quickAccessLevel":"/powertrain/"
            "enabledModes":["2hi", "4hi", "4lo"]
            "defaultMode": "4hi"
            "modes": {
                "2hi": {
                    "name": "2WD High Gear",
                    "order": 10,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"rangebox", "mode":"high"}]
                        ["powertrainDeviceMode", {"deviceName":"transfercase_F", "mode":"disconnected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFR", "mode":"disconnected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFL", "mode":"disconnected"}]
                        ["electricsValue", {"electricsName":"transfercase_state", "value":1}]
                        ["simpleControlButton", {"buttonId":"transfercase", "icon":"powertrain_transfercase_high-2", "uiName":"Transfercase"}]
                        ["quickAccess", {"icon":"powertrain_transfercase_high-2"}]
                    ],
                },
                "4hi": {
                    "name": "4WD High Gear",
                    "order": 20,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"rangebox", "mode":"high"}]
                        ["powertrainDeviceMode", {"deviceName":"transfercase_F", "mode":"connected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFR", "mode":"connected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFL", "mode":"connected"}]
                        ["electricsValue", {"electricsName":"transfercase_state", "value":0.33}]
                        ["simpleControlButton", {"buttonId":"transfercase", "icon":"powertrain_transfercase_high-4", "uiName":"Transfercase"}]
                        ["quickAccess", {"icon":"powertrain_transfercase_high-4"}]
                    ],
                },
                "4lo": {
                    "name": "4WD Low Gear",
                    "order": 30,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"rangebox", "mode":"low"}]
                        ["powertrainDeviceMode", {"deviceName":"transfercase_F", "mode":"connected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFR", "mode":"connected"}]
                        ["powertrainDeviceMode", {"deviceName":"wheelaxleFL", "mode":"connected"}]
                        ["electricsValue", {"electricsName":"transfercase_state", "value":-1}]
                        ["simpleControlButton", {"buttonId":"transfercase", "icon":"powertrain_transfercase_low-4", "uiName":"Transfercase"}]
                        ["quickAccess", {"icon":"powertrain_transfercase_low-4"}]
                    ],
                },
            }
        }
        "powertrain" : [
            ["type", "name", "inputName", "inputIndex"],
            ["rangeBox", "rangebox", "gearbox", 1, {"uiSimpleModeControl":false, "gearRatios":[1,4], "uiName":"Rangebox"}],   
        ],
        "gearbox": {
            "uiName":"Gearbox",
            //added stabilization for one way clutch with ultra low range
            "oneWayViscousCoef":20,
            "oneWayViscousSmoothing":100,
        },
        "torqueConverter": {
            "uiName":"Torque Converter",
            //added stabilization for torque converter with ultra low range
            "kFactorSmoothing":250,
        },
    
     
    • Like Like x 1
  7. gigisfan

    gigisfan
    Expand Collapse

    Joined:
    Aug 17, 2013
    Messages:
    101
    That`s very helpful, thank you.

    The Stambecco uses the old system apparently but it spawns with front shaft disconnected: how I obtain this?
     
  8. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,414
    It uses the new system, but has separate controls for each device instead of a single control for everything.
    Code:
        "controller": [
            ["fileName"],
            ["vehicleController", {}]
            ["driveModes", {"name":"frontLockControl"}]
            ["driveModes", {"name":"transfercaseControl"}]
            ["driveModes", {"name":"rearLockControl"}]
            ["driveModes", {"name":"rangeboxControl"}]
            ["4wd", {"driveModesRangeNames":["rangeboxControl"], "driveModesTransfercaseNames":["transfercaseControl"], "driveModesDifferentialNames":["frontLockControl", "rearLockControl"]}],
        ],
        "frontLockControl":{
            "uiName": "Front Differential"
            "quickAccessTitle":"Front Differential"
            "quickAccessIcon":"powertrain_differential_front_default"
            "quickAccessLevel":"/powertrain/"
            "enabledModes":["unlocked", "locked"]
            "defaultMode": "unlocked"
            "modes": {
                "unlocked": {
                    "name": "Unlocked",
                    "order": 10,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"differential_F", "mode":"open"}]
                        ["electricsValue", {"electricsName":"front_lock", "value":0}]
                        ["quickAccess", {"icon":"powertrain_differential_front_default"}]
                        ["simpleControlButton", {"buttonId":"frontDiff", "icon":"powertrain_differential_open", "uiName":"Front Differential"}]
                    ],
                },
                "locked": {
                    "name": "Locked",
                    "order": 20,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"differential_F", "mode":"locked"}]
                        ["electricsValue", {"electricsName":"front_lock", "value":1}]
                        ["quickAccess", {"icon":"powertrain_differential_front_locked"}]
                        ["simpleControlButton", {"buttonId":"frontDiff", "icon":"powertrain_differential_closed", "uiName":"Front Differential"}]
                    ],
                },
            }
        }
        "transfercaseControl":{
            "uiName": "Transfercase"
            "quickAccessTitle":"Transfercase"
            "quickAccessIcon":"powertrain_differential_middle_default"
            "quickAccessLevel":"/powertrain/"
            "enabledModes":["unlocked", "locked"]
            "defaultMode": "unlocked"
            "modes": {
                "unlocked": {
                    "name": "Unlocked",
                    "order": 10,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"intershaft_F", "mode":"disconnected"}]
                        ["electricsValue", {"electricsName":"transfercase_lock", "value":0}]
                        ["quickAccess", {"icon":"powertrain_differential_middle_default"}]
                        ["simpleControlButton", {"buttonId":"transfercase", "icon":"powertrain_shaft_disconnected", "uiName":"Transfercase"}]
                    ],
                },
                "locked": {
                    "name": "Locked",
                    "order": 20,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"intershaft_F", "mode":"connected"}]
                        ["electricsValue", {"electricsName":"transfercase_lock", "value":1}]
                        ["quickAccess", {"icon":"powertrain_differential_middle_locked"}]
                        ["simpleControlButton", {"buttonId":"transfercase", "icon":"powertrain_shaft_connected", "uiName":"Transfercase"}]
                    ],
                },
            }
        }
        "rearLockControl":{
            "uiName": "Rear Differential"
            "quickAccessTitle":"Rear Differential"
            "quickAccessIcon":"powertrain_differential_rear_default"
            "quickAccessLevel":"/powertrain/"
            "enabledModes":["unlocked", "locked"]
            "defaultMode": "unlocked"
            "modes": {
                "unlocked": {
                    "name": "Unlocked",
                    "order": 10,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"differential_R", "mode":"open"}]
                        ["powertrainDeviceMode", {"deviceName":"differential_RR", "mode":"open"}]
                        ["electricsValue", {"electricsName":"rear_lock", "value":0}]
                        ["quickAccess", {"icon":"powertrain_differential_rear_default"}]
                        ["simpleControlButton", {"buttonId":"rearDiff", "icon":"powertrain_differential_open", "uiName":"Rear Differential"}]
                    ],
                },
                "locked": {
                    "name": "Locked",
                    "order": 20,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"differential_R", "mode":"locked"}]
                        ["powertrainDeviceMode", {"deviceName":"differential_RR", "mode":"locked"}]
                        ["electricsValue", {"electricsName":"rear_lock", "value":1}]
                        ["quickAccess", {"icon":"powertrain_differential_rear_locked"}]
                        ["simpleControlButton", {"buttonId":"rearDiff", "icon":"powertrain_differential_closed", "uiName":"Rear Differential"}]
                    ],
                },
            }
        }
        "rangeboxControl":{
            "uiName": "Rangebox"
            "quickAccessTitle":"Rangebox"
            "quickAccessIcon":"powertrain_rangebox_high"
            "quickAccessLevel":"/powertrain/"
            "enabledModes":["high", "low"]
            "defaultMode": "high"
            "modes": {
                "high": {
                    "name": "High",
                    "order": 10,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"rangebox", "mode":"high"}]
                        ["electricsValue", {"electricsName":"rangebox_state", "value":0}]
                        ["quickAccess", {"icon":"powertrain_rangebox_high"}]
                        ["simpleControlButton", {"buttonId":"rangebox", "icon":"powertrain_rangebox_high", "uiName":"Rangebox"}]
                    ],
                },
                "low": {
                    "name": "Low",
                    "order": 20,
                    "settings": [
                        ["type"]
                        ["powertrainDeviceMode", {"deviceName":"rangebox", "mode":"low"}]
                        ["electricsValue", {"electricsName":"rangebox_state", "value":1}]
                        ["quickAccess", {"icon":"powertrain_rangebox_low"}]
                        ["simpleControlButton", {"buttonId":"rangebox", "icon":"powertrain_rangebox_low", "uiName":"Rangebox"}]
                    ],
                },
            }
        }
    
     
    • Like Like x 1
  9. gigisfan

    gigisfan
    Expand Collapse

    Joined:
    Aug 17, 2013
    Messages:
    101
    I was looking into the wrong jbeam file, that explains a lot.

    Thanks again!
     
  10. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,414
    Yeah I don't understand why these things were put in the main file instead of transfer case. Glad I could help.
     
  11. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    Btw, the old stuff also has the ability to spawn in 2WD, we just never used it.
     
  12. gigisfan

    gigisfan
    Expand Collapse

    Joined:
    Aug 17, 2013
    Messages:
    101
    can you explain how?
     
  13. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,414
    Isn't it obvious? There is a "defaultMode" parameter in the Jbeam files I posted
     
  14. gigisfan

    gigisfan
    Expand Collapse

    Joined:
    Aug 17, 2013
    Messages:
    101
    he said in the old code, I am curious about it
     
  15. securiteeboyz

    securiteeboyz
    Expand Collapse

    Joined:
    Aug 2, 2016
    Messages:
    17
    In real life people can turn 4WD on themselves, but your AI is not smart enough to turn it on meaning AI won't have 4WD now unless I manually force it or use AWD transfer case(which overheats clutches not a fix). The demolition derby mod I use spawns up to 17 AI cars I would have to take 5 minutes every event to manually turn on the AI's transfer case to 4 wheel high. I love the game but I strongly dislike this change I'm just frustrated there's not option seems like it wouldn't be that hard.
     
  16. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,414
    Maybe add an option for AI to turn on 4WD after losing traction, like a human would probably do irl
     
  17. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    if you have a mod that is specifically interested in doing offroad things, it's probably best to have the mod configure these things from code, that way you have full control over what is going on.
     
  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