The dropdown menu just changes the line that gets generated in the dungeon.lua. It doesn't do anything else. So if you want to "undo" it, you can just remove the
Code: Select all
script_entity_8.script:loadFile("mod_assets/scripts/yunintemple.lua")
line (or change it back to monsters.lua if you really want to get your old error back).
Of course, this doesn't really help with the error you describe. It's extremely strange that the code in the screenshot would result in that error. Neither of the possibilities seem very likely:
1.
script_entity_8 is nil. It's just been spawned on a map, one line ago, so the only way this could happen is if you're loading the dungeon.lua from your init.lua, in which case I'd expect an error
much sooner (for one,
spawn would probably be nil!)
2.
script_entity_8.script is nil. This could only happen if you have changed the definition of script_entity to remove or rename its ScriptComponent.
(The error can't can't be coming from within loadFile, because this is the complete source code of loadFile:
Code: Select all
function ScriptComponent:loadFile(filename)
self.source = filename
self.scriptType = "external"
end
The only indexes performed are to
self, i.e. script_entity_8.script in this case, and if that were nil, you wouldn't get far enough to call loadFile)