Solved add mod controller to all cars

Discussion in 'Mod Support' started by LoSboccacc, Apr 22, 2022.

  1. LoSboccacc

    LoSboccacc
    Expand Collapse

    Joined:
    Feb 22, 2016
    Messages:
    23
    I want to add a mod controller and I want it to be added to all existing cars by default, I created a stub out of the esc controller, but I don't know how would I go and thell the main controller to call my modded controller
     
  2. S.Ali.M

    S.Ali.M
    Expand Collapse

    Joined:
    Jan 12, 2021
    Messages:
    1,076
    You can put it in lua/vehicle/extensions/auto
    Then your the code will run automatically on all cars, even modded ones
    You need to change some things btw
    For example you need to change the onInit function to onExtensionLoaded

    But if you want your controller to be loaded when a certain part is applied, you need to put it in lua/vehicle/controller and write something like this in the jbeam file
    "controller":{
    ["fileName"]
    {"write_controller_name_here", []}
    }
     
  3. LoSboccacc

    LoSboccacc
    Expand Collapse

    Joined:
    Feb 22, 2016
    Messages:
    23
  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