Solved Lua energy storage

Discussion in 'Mod Support' started by crashmaster, Dec 29, 2018.

  1. crashmaster

    crashmaster
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,812
    Im currently trying to add methanol for a mod im making. i can only add the fuel type in the fueltank.lua in the beam dir, but i wanna add methanol in my mods folder instead.
    How to?
    upload_2018-12-29_16-7-44.png
    I noticed in another lua file that it looks up for a specific lua folder located lua/vehicle/energyStorage
    is this whats stopping me from making it work in another folder or am i really that noob in lua?
    What am i missing here?
     

    Attached Files:

    • Like Like x 1
  2. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    There's no need to modify any lua files for this.
    Just configure the existing fuelTank in jbeam with the correct data for these attributes:
    Code:
    energyType --set to "methanol" or whatever else you want, need to use the same string in the combustion engine required fueltype
    energyDensity --MJ/kg
    fuelLiquidDensity --kg/L
    The fuelTank code has presets for a bunch of different fuels, but you can just specify whatever you want directly in jbeam :)
     
    • Informative Informative x 3
    • Like Like x 2
  3. crashmaster

    crashmaster
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,812
    Nice thanks!.

    Just gonna put this bit of info out there too.
    I tried adding the fuel density the same way its written in the lua, which is 19.7*1000000 but that ended up giving me errors and wouldnt work.
    upload_2018-12-30_17-35-52.png
    Unless i did something wrong again, it worked if it didnt have to multiply things.
     
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  4. Deleted member 160369

    Deleted member 160369
    Expand Collapse
    Guest

    • Agree Agree x 2
    • 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