Refill N2O in Lua trigger

Discussion in 'Programming' started by It's No Use, Feb 3, 2022.

  1. It's No Use

    It's No Use
    Expand Collapse

    Joined:
    Jun 16, 2014
    Messages:
    46
    I'm attempting to refill a current car's N20 when it enters a lua trigger. I thought I could base such a command off of the following line,
    Code:
    be:getPlayerVehicle(0):queueLuaCommand("energyStorage.getStorage('mainBottle'):setRemainingVolume(200)")
    but that doesn't seem to be the case. It should be easy to implement since nitrous oxide is an energyStorage device, right?
    EDIT:
    After trial and error, I got a working command:
    Code:
    be:getPlayerVehicle(0):queueLuaCommand("energyStorage.getStorage('mainBottle'):setRemainingMass(200)")
     
    #1 It's No Use, Feb 3, 2022
    Last edited: Feb 3, 2022
    • Like Like x 1
  2. over_the_reckoning

    over_the_reckoning
    Expand Collapse

    Joined:
    Aug 7, 2020
    Messages:
    19
    I tried with another command line to refuel as I enter "lua trigger" area with Current Vehicle...
    but nothing happened as i write following SYNTAX
    energyStorage.getStorage('mainTank'):setRemainingRatio(1)

    ...this one just works in beamng console...
     

    Attached Files:

    • gas_station.png
  3. over_the_reckoning

    over_the_reckoning
    Expand Collapse

    Joined:
    Aug 7, 2020
    Messages:
    19
    I tried with another command line to refuel a diesel Gavril with two tanks, as I enter "lua trigger" area with Current Vehicle...
    but nothing happened as i write following SYNTAX
    energyStorage.reset()

    This just reset the fuel amount and nothing else.

    ...this one just works in beamng console...
     
  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