Check Engine Light

Discussion in 'Content Creation' started by Skwerly1, Apr 21, 2022.

  1. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    Okay so theres a check engine light that only shows up when the engine is literally sent to heaven.
    I was wondering if there was a way to create a mod to activate said check engine light when the intake, oil pan, or even by pressing a button lol

    Which script controls the engine light when the engine is disabled, and is it possible to hotkey it to activate on command/when intake or oil pan, or other engine problems arise?
     
  2. Duh anime addict

    Duh anime addict
    Expand Collapse

    Joined:
    Aug 5, 2021
    Messages:
    532
    ask @angelo234
    He's a god at lua
     
    • Agree Agree x 2
  3. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    I have it figured out! I just made a command to turn the light on at the press of a key :)
    Will post screenshots of it later on when it's fully working. It is giving me errors and I am still learning LUA haha
     
  4. HighVoltage_Guy

    HighVoltage_Guy
    Expand Collapse
    Banned

    Joined:
    Jul 5, 2021
    Messages:
    318
    Does lua stuff modding is made in the in game console?
     
  5. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    Nah, its done from the game files

    upload_2022-4-21_0-6-5.png
     
  6. HighVoltage_Guy

    HighVoltage_Guy
    Expand Collapse
    Banned

    Joined:
    Jul 5, 2021
    Messages:
    318
    Oh my lord
     
    • Agree Agree x 1
  7. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    The engine light is handled in vehicleController.lua, the line for that is 449: electrics.values.checkengine = controlLogicModule.checkengine or false
     
  8. B727ClassicFlyer

    B727ClassicFlyer
    Expand Collapse

    Joined:
    Feb 9, 2013
    Messages:
    2,177
    Just tried doing that in the console by changing false to true and nothing.
     
  9. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    There does seem to be a lot more to it then just setting a value to true. It appears to be controlled by a "mainEngine" line, but I can't seem to figure out which one.

    I'm going to keep looking!
     
  10. angelo234

    angelo234
    Expand Collapse
    Junior Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    429
    angelo234 at your service :)
    Code:
    powertrain.getDevice("mainEngine").isDisabled = true
    Only thing is that you won't be able to start the engine when isDisabled is true lol

    I guess when the engine is off, you can just set that to false.
     
    #10 angelo234, Apr 22, 2022
    Last edited: Apr 22, 2022
    • Like Like x 3
  11. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    I figured that one out lol
    I might have also figured out how to activate the check engine light with a key press tho, I have to test it to verify.
     
    • Like Like x 2
  12. dumpling

    dumpling
    Expand Collapse

    Joined:
    Jan 28, 2021
    Messages:
    522
    Omg this will be useful for the LR Defender TFL config! TFL's first Defender had it's check engine light on irl so this would be nice to add into the wacky config, thanks!
    --- Post updated ---
    I have only one question, since I am completely new to lua just now I have no idea where the vehicleController.lua is located, can anyone help?
    --- Post updated ---
    Oh no I just put myself into a bigger black hole, since I don't want the original gauge to have the check engine light on, is it possible to make a separate gauge? (I probably shouldn't be doing this now sorry...)
     
    • Like Like x 2
  13. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    //common\BeamNG.drive\lua\vehicle\controller\vehicleController.lua

    It should be in your main install, under LUA ---> vehicle ---> controller
    --- Post updated ---
    "drive Letter":\SteamLibrary\steamapps\common\BeamNG.drive\lua\vehicle\controller
    or more commonly
    C:\Program Files (x86)\Steam\steamapps\common\beamNG.Drive\lua\vehicle\controller
    --- Post updated ---
    Yes, totally possible!
    I could help out if you need^^
     
    • Like Like x 2
  14. dumpling

    dumpling
    Expand Collapse

    Joined:
    Jan 28, 2021
    Messages:
    522
    Please do! :) It's always nice to have someone guide you through new topics such as this :D
    --- Post updated ---
    I have found the vehicleController file, but now how should I make it separate and only for for the mod?
    --- Post updated ---
    Yes! I got the check engine to turn on, but now I only have to make a separate gauge that only turns the check engine light on
     
  15. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    If you'd like, add my Discord!
    Naz the Wolf#9173
    --- Post updated ---
    Also, yes you should seperate the LUA, and as far as I know, rename it too ^^
     
  16. dumpling

    dumpling
    Expand Collapse

    Joined:
    Jan 28, 2021
    Messages:
    522
    I have found the vehicleController file, but now how should I make it seperate and work only for the
    Your Discord is currently not accepting any friends, but that's ok. :) Try mine: dumdumdum #2642
     
  17. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    Ah, I apologize, I have my privacy settings set to avoid random people from servers haha
     
  18. dumpling

    dumpling
    Expand Collapse

    Joined:
    Jan 28, 2021
    Messages:
    522
    I have encountered a problem: Everything was fine until I decided to change the controller file name to the one that have the check engine light on, the "broken" gauges are now really broken as they have no texture. Again I am completely new to this so I have no idea if I'm doing this the correct way
    Screenshot2022-04-21175349.png Screenshot2022-04-21174316.png
     
    #18 dumpling, Apr 22, 2022
    Last edited: Apr 22, 2022
  19. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    The files listed there need to be duplicated and named to gaugesb as well :D
     
  20. dumpling

    dumpling
    Expand Collapse

    Joined:
    Jan 28, 2021
    Messages:
    522
    Which files exactly? I am a bit confused on everything :confused:
    --- Post updated ---
    The NO MATERIALS is still there after a lot of trying... If anyone else would like to help me try to create a separate lua for a separate gauge please help, thanks!
     
    #20 dumpling, Apr 22, 2022
    Last edited: Apr 22, 2022
  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