Error while modding
Posted: Thu Nov 15, 2012 3:27 pm
Yeah, ok, so while modding i'm liable to break something, but this is throwing an error in a function I haven't touched so its got me scratching my head a little.Its the mod i'm working on to increase traffic in the system. Happens quite quickly in systems where more ships will be spawned (sometimes almost instantly), especially on new game in Sol or New Hope.I'm wondering if it could be a problem with the game but rare, because not usually so many ships flying around, and its just more likely to be triggered when i'm spawning lots of traders.Anyway, here is the output of stderr:
Quote:
Error: Lua custom Systems definition: Surface starport is underwater (height not greater than 0.0) and has been automatically relocated. Please move the starport to another location by changing latitude and longitude fields.Surface starport name: New Hope, Body name: New Hope, In sector: x = 1, y = -1, z = -1.Error: [string "modules/TradeShips.lua"]:230: bad argument #1 to 'pairs' (table expected, got nil)stack traceback:[C]: in function 'pairs'[string "modules/TradeShips.lua"]:230: in function 'getSystem'[string "modules/TradeShips.lua"]:281: in function 'getSystemAndJump'[string "modules/TradeShips.lua"]:590: in function 'cb'[string "libs/00-Event.lua"]:32: in function '?'[string "libs/00-Event.lua"]:182: in function <[string "libs/00-Event.lua"]:177>
The actual line which it is referencing (line 230, getSystem) is: for cargo, count in pairs(trade_ships[ship]['cargo']) doWhy could it be getting nil when table expected, and ok, assuming an empty table, then why does it not handle it gracefully?Thoughts?
Quote:
Error: Lua custom Systems definition: Surface starport is underwater (height not greater than 0.0) and has been automatically relocated. Please move the starport to another location by changing latitude and longitude fields.Surface starport name: New Hope, Body name: New Hope, In sector: x = 1, y = -1, z = -1.Error: [string "modules/TradeShips.lua"]:230: bad argument #1 to 'pairs' (table expected, got nil)stack traceback:[C]: in function 'pairs'[string "modules/TradeShips.lua"]:230: in function 'getSystem'[string "modules/TradeShips.lua"]:281: in function 'getSystemAndJump'[string "modules/TradeShips.lua"]:590: in function 'cb'[string "libs/00-Event.lua"]:32: in function '?'[string "libs/00-Event.lua"]:182: in function <[string "libs/00-Event.lua"]:177>
The actual line which it is referencing (line 230, getSystem) is: for cargo, count in pairs(trade_ships[ship]['cargo']) doWhy could it be getting nil when table expected, and ok, assuming an empty table, then why does it not handle it gracefully?Thoughts?