Hey there, I am currently working on update for both of my maps "East Coast USA with lights!" and "West Coast USA with lights!" but I can't get the mainlevel.lua which controls the lighting to work anymore. The new update added a code for the garage on West Coast USA and it prevents me with my knowledge about this stuff, to get the original code to work. Code used 'till now : local M = {} local function setAllLightsEnabled(group, value) for i = 0, group.obj:getCount(), 1 do local id = group.obj:idAt(i) local obj = scenetree.findObjectById(id) if obj and obj.obj:isSubClassOf('LightBase') then obj.obj:setLightEnabled( value ) end end end local lastValue = nil local function onUpdate() local tod = scenetree.tod if not tod then return end local value = false if tod.time > 0.21 and tod.time < 0.77 then value = true end if lastValue == value then return end lastValue = value if scenetree.auto_repair_lights then setAllLightsEnabled(scenetree.auto_repair_lights, value ) setAllLightsEnabled(scenetree.tourist_center_lights, value ) end end M.onUpdate = onUpdate return M The code on West Coast USA (currently) : local M = {} -- garage lights --local function setupGarageTables() -- creates garage lights data --if true then --extensions.load('core_extendedTriggers') --core_extendedTriggers.setup() --return --end --end return M Any help is appreciated
I have no clue how Lua works, but have you tried putting your code’s „inside” (between „local M” and „return M”) into copy of WCUSA’s files’ „inside”? So like this: local M [garage stuff] [your stuff] return M
Thanks for the reply. I am gonna try that right away. Edit : It didn't work. Or better, it might work but the main Menu background covers the game. I can drive the car (hear it driving) and I see the UI but the main Menu background covers everything when I load this map.
Solved the issue by removing unnecessary lines from the code which referred to ingame-folders which weren't on the map.