I'm trying to have certain units added to a table when they spawn (along with a list of useful information such as their GetCharacterUnit data, GetCharacterTeam, and some other items). That part works fine, but I'm running into this error when I try and remove them from the table upon their death (maybe I shouldn't be trying to do that...?).
Error:
Code: Select all
Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index field `?' (a nil value)
stack traceback:
(none): in function <(none):1021>
Hidden/Spoiler:
EDIT: It occurred to me just now that if the character is dead, then 'character' would be nil, right? So then I don't really have a way of looking the guy up in the table. Does anyone have any suggestions? guardList.Unit won't work because GetCharacterUnit(character) will also return a nil since the unit doesn't exist (y'know, cause he's dead).



