Lua console commands

Discussion in 'Programming' started by PriusRepellent, Nov 13, 2018.

  1. PriusRepellent

    PriusRepellent
    Expand Collapse

    Joined:
    Mar 19, 2018
    Messages:
    353
    I've seen some old threads around with people asking how to destroy their engine using the lua console. Yet I found no answers. So, I decided to do some digging and experimenting of my own. In the process, I discovered how to do such things.

    I am putting together some useful lines of lua codes that can be run in the console.

    BeamNG - Vehicle Lua:

    Powertrain reference and examples:
    Code:
    for k,v in pairs(powertrain.getDevice("mainEngine")) do print(k) end
    Code:
    powertrain.getDevice("mainEngine").maxTorqueRating = #
    I hope this gives at least someone a good place to start.

    Reset your fuel via console:
    Code:
    energyStorage.reset()
    `
    Make your fuel tank leak:
    Code:
    energyStorage.getStorages().mainTank.currentLeakRate = 0.1
    Edit temperatures:
    Code:
    powertrain.getDevice("mainEngine").thermals.engineBlockTemperature = 20
    powertrain.getDevice("mainEngine").thermals.coolantTemperature = 20
     
    #1 PriusRepellent, Nov 13, 2018
    Last edited: Nov 14, 2018
    • Like Like x 1
  2. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
  3. PriusRepellent

    PriusRepellent
    Expand Collapse

    Joined:
    Mar 19, 2018
    Messages:
    353
    What I'd really like to do is use this thread to gather knowledge together, organize it then put it nice and neatly onto the Wiki. Lua parts of the game are missing a lot of documentation so I think this would be quite helpful.
     
    • Like Like x 1
  4. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,683
    Lua is missing a lot of documentation in part because it changes constantly.
     
    • Agree Agree x 2
  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