So I’ve got an interesting issue where a script bound to Lua (
lua_add_function(...)) is having its value changed somewhere between its “return” statement
show_debug_message(BattleActions.SKILL); return BattleActions.SKILL;
and where it’s value is used in the Lua code
local def = Battle.default_act(me) print(def)
(printouts: 0, 1)
The bound script seems to “return” 1 no matter what actually goes in front of the return statement - a number, text, nothing at all, etc. I tried tracing it through the
lua_script_execute in the extension itself using breakpoints and printouts, but most of the returned values inside there seem to be either pointers inside a buffer or instance IDs and I can’t really tell where anything gets lost. I’m not sure if “1” is supposed to represent “true,” or if it’s erroneously turning into “1 return result” as in some of the other lua_call functions, or if it’s just an arbitrary value somewhere in memory.
Side note: big thanks for doing this. This is a really odd issue that I haven’t been able to figure out for two days, but overall using Lua has been really useful for keeping certain parts of my code separate from each other.