Simple mod ("Hello World") on client side its impossible? I'm trying to create a mod script, but I can't even do the basics, it doesn't work or the script didn't load. Users\\...\\AppData\\Local\\[BeamNG.drive](https://beamng.drive/)\\0.31\\mods\\repo\\[MyMod.zip](https://mymod.zip/)\\main.lua function onInit() log('Hello World') end
You're not doing it correctly. Do the following (Same code and folder structure, create them if they are not there already) 0.31/mods/unpacked/myMod/ <-- This is where your mods will go lua/ge/extensions/ <-- The game uses a thing called "extensions", this is where your entry point will go myMod.lua <-- Your magical filescripts/myMod/ modScript.lua <-- The game will look for this to determine what to load and how In "myMod.lua", put the following: Code: local M = {} -- This is your module (hence the "M") local function onExtensionLoaded() log('D', "onExtensionLoaded", "Called!") end M.onExtensionLoaded = onExtensionLoaded -- We want to expose this to the module so the game can call it return M -- The game requires the module, so we must return it so the game can access it. That way it can call the "onExtensionLoaded" function In "modScript.lua", put the following: Code: load("myMod") -- Load the mod setExtensionUnloadMode("myMod", "manual") -- Set the unload mode to manual (This is very new, old function is deprecated) Hopefully this helps, if not then oh well. Just take a look through the game's scripts to see how it all works
One of the developers, Stenyak, has done a really good job on this https://documentation.beamng.com/modding/programming/ so check it out when you have the time, it's got some really valuable information