Mods improvements

Discussion in 'Utilities and programming' started by tdev, Jun 7, 2016.

  1. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    So, thanks to @Scepheo's feedback i added a new feature that allows to load vehicle extensions automatically.

    I only added this to lua/vehicle/main.lua in line 132
    Code:
        extensions.loadModules("lua/vehicle/extensions/auto")
    
    You can download the full file here.

    This will allow you to load vehicle extensions automatically. Example here.

    This change will be in the next release (which will take some more weeks now). So you could start developing with this in mind.

    Anything else that we can improve?
     

    Attached Files:

    #1 tdev, Jun 7, 2016
    Last edited: Jun 7, 2016
    • Like Like x 3
  2. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Due to how the game searches for mod scripts ("/scripts/modScript.lua"), it will only ever find and execute a single one. Perhaps using a similar scheme (anything in "/scripts/auto" is executed on game start) can solve that too?
     
  3. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    no, you are supposed to put modScript.lua into a subfolder for that mod. I.e. scripts/myMod/modScript.lua
    This way you can have multiple of them.
     
  4. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Huh, I'd have sworn I tried doing that. Oh well, never mind then.
     
  5. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    don't worry, since we severely lack documentation, Its amazing what you and the others produce :)
     
    • Like Like x 1
  6. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    754
    Glad to see this is being implemented!
    Now I won't have to modify the main.lua file anymore for MFM ;)
     
  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