Unsolved Variable AirRide

Discussion in 'Mod Support' started by Jammy25, Jul 12, 2020.

  1. Jammy25

    Jammy25
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    93
    Hello,
    I am in the process of updating some Automation mods, and in doing so I have followed the tutorials on how to add air-ride.
    This works fine however I would like to be able to have more settings e.g. a default height, off-road height and lowered height.
    The issue is that the hydros seem to be able to either contract or expand from their original size and cannot do both... so I need to have some sort of centre point in between the hydros max travel and minimum travel... but idk how to do that.
    It can currently only do either the max height or the min height and no in between, in between being here I would like to put a default height

    screenshot_2020-07-12_19-44-33.png
    max. height
    screenshot_2020-07-12_19-49-41.png
    min. height

    Various files used

    keyboard.json
    Code:
    {
    "bindings" :   [
        {
        "control"           : "pagedown"            ,
        "action"            : "heightdown"          
        },
        {
        "control"           : "pageup"            ,
        "action"            : "heightup"          
        },
      ],
    "name"              : "Keyboard"          ,
    "version"           : 1                   ,
    "devicetype"        : "keyboard"          ,
    "vidpid"            : "6F1D2B61"          ,
    "guid"              : "{6F1D2B61-D5A0-11CF-BFC7-444553540000}"
    },
    
    lua
    Code:
    local M = {}
    
    local function onReset()
      electrics.values['lifter'] = 0
      electrics.values['lifter_input'] = 0
      electrics.values['shoot'] = 0
    end
    
    local function updateGFX(dt) -- ms
        electrics.values['lifter'] = math.min(1, math.max(-0.0, (electrics.values['lifter'] + electrics.values['lifter_input'] * dt * 0.2)))
    end
    
    local function liftBarrel(value)
      electrics.values.lifter_input = value
    end
    
    -- public interface
    M.onInit    = onReset
    M.onReset   = onReset
    M.updateGFX = updateGFX
    M.fire      = fire
    M.liftBarrel = liftBarrel
    
    return M
    input_actions.json
    Code:
    {
    "heightdown"   :{"order":  3, "isCentered":true,"onChange":"custom_input.liftBarrel(-5 * VALUE)", "title": "Toggle Ride Height Down", "desc": "Changes Ride Height Down" },
    "heightup"   :{"order":  4, "isCentered":true,"onChange":"custom_input.liftBarrel(5 * VALUE)", "title": "Toggle Ride Height Up", "desc": "Changes Ride Height Up" },
    }
    airstrut f hydros
    Code:
    "hydros": [
                ["id1:", "id2:"],
                {"beamPrecompression":1.0, "beamType":"|HYDRO"},
                {"beamSpring":55200.000000,"beamDamp":0},
                {"beamDeform":88419.546875,"beamStrength":435162.875000},
            ["fh1r","fs1r", {"inputSource":"lifter","inLimit":1,"outLimit":0.65,"inRate":1,"outRate":1,"inputFactor":1.0}],
                ["fh1l","fs1l", {"inputSource":"lifter","inLimit":1,"outLimit":0.65,"inRate":1,"outRate":1,"inputFactor":1.0}],
                {"breakGroup":""},
        ],
    Any help is appreciated!

    edit: info on current ability
     
    #1 Jammy25, Jul 12, 2020
    Last edited: Jul 12, 2020
  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