When loading a save game, a server init script gets aborted when one of its
require statements returns, for some completely inexplicable reason, the string value of an error experienced earlier during loading. (The aborting when causing a Lua error by treating a string as a table is understandable; the condition that allows this situation to happen is not.)
Steps to reproduce:
Not sure exactly, but I could attach a save game that, depending on what mods were enabled, would reliably cause it. My hunch is that it has something to do with missing entities from manifests and/or missing components on existing entities (e.g., the component was removed from the entity in an update to the mod, but the saved entity still has the component).
require on valid paths should work all the time, including during normal server init script running (e.g., after
'radiant:required_loaded'). The paths load fine under other conditions, so it’s not a problem with that.
require causes the server init script to fail out, causing a chain reaction of failures because other things aren’t loaded properly.
I don’t know how this could be happening without some sort of low-level corruption, like a buffer overflow. I’d love to be wrong on that.
Attachments: Will attach if someone would actually get use out of it. In this case, when
require was run on the
ace_farming_task_group lua file, the resulting string was this:
stonehearth/components/portal/portal_component.lua:9: attempt to index local 'json' (a nil value)
which was an error experienced from the earlier loading of an entity whose mod was disabled. Once the game finished loading (in a broken-mod state, since many other monkey-patches weren’t applied), running
require on that file from the Lua debug console worked normally.
Version Number and Mods in use: Latest SH, latest unstable ACE, and various other mods in this save file.