How to start/stop supercharger manualy (on fly)?

Discussion in 'Programming' started by g.f.m.lab, Feb 18, 2023.

  1. g.f.m.lab

    g.f.m.lab
    Expand Collapse

    Joined:
    Feb 18, 2023
    Messages:
    2
    The "supercharger": "clutchEngageRPM" and "clutchDisengageRPM" sets up as one of the first steps when parsing the vehicle and have no meaning after initialization? Did I understand correctly?
    This code work fine:
    Code:
     "variables": [
            ["name", "type", "unit", "category", "default", "min", "max", "title", "description"],
            ["$scharger_on", "range", "off/on", "Supercharger", 0,0,10000, "Manual Supercharger switch", "switch position (engage/disengage supercharger)", {"stepDis":1, "maxDis":1}],
            ],
            "supercharger": {
            "clutchDisengageRPM": "$scharger_on",   
            },
    But I need to start and stop supercharger manualy on fly too.
    How to do it using Jbeam/LUA?
     
  2. Jackets64

    Jackets64
    Expand Collapse

    Joined:
    Nov 26, 2017
    Messages:
    1,913
    See if you can figure out what the devs did with the Bastion's ESC, on the "Caged" mode the supercharger is consistently disabled.
     
  3. g.f.m.lab

    g.f.m.lab
    Expand Collapse

    Joined:
    Feb 18, 2023
    Messages:
    2
    Excellent! Thank you for prompt about Bastion's drive mode.
    My supercharger work fine and can be switched on fly with "lua\vehicle\controller\driveModes.lua" now.
    The next one is supercharger pulley spin and stop attached to "drivemodes" controller code.
    Code:
     
        "controller": [
                ["fileName"],
                ["driveModes"]
        ],
           "driveModes": {
                "enabledModes":["SC_engaged", "SC_disengaged"]
                "defaultMode": "SC_disengaged"
            "modes": {
                    "SC_engaged": {
                        "name": "SuperCharger engaged",
                        "order": 10,
                        "settings": [
                            ["type"]
                            ["supercharger", {"name": "mainEngine", "bypassPressure": 9999}]
                       ],
                    },
                    "SC_disengaged": {
                        "name": "SuperCharger disengaged",
                        "order": 20,
                        "settings": [
                            ["type"]
                            ["supercharger", {"name": "mainEngine", "bypassPressure": 0}]
                        ],
                    },
                },
            },
    
     
    #3 g.f.m.lab, Feb 20, 2023
    Last edited: Feb 20, 2023
    • 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