I have been trying to simulate the infamous V8-6-4 fuel injection engine from Cadillac for a while. I have revised my code several times, trying to get it to work. Here is my latest problem. 213.07904|E|libbeamng.Lua.Exception|vehicles/oldsfullsize//lua/powertrain/CombustionEngine.lua:1193: attempt to index global 'device' (a nil value). My code has nothing to do with this line, I just had to edit something above it. What's wrong with my code?
If something prevents engine to be loaded or some part of powertrain fails, it can then cause nil happening on some other line that request what was missing because fail to load because of edit. It is like domino effect, comma in wrong place causes something not to load and you get error from completely different that is not finding part not loading because some other error. Do have line numbers of which you have edited, I did try to look, but having to go trough thousand or so of lines is not exactly easy on time department?
not sure what IDE you are using but line 1192 is outside a function, It will get executed while parsing. just move the last 'end' from line 1190 after line 1200