A couple of Lua bugs and a suggestion
Posted: Wed Feb 15, 2017 3:43 am
I bumped into some oddities while hooking up some game features into the built-in Lua interpreter:
...prints 0. If you assign foo to some other variable before the loop, that variable gets modified too. You can work around this by forcing the interpreter to evaluate an expression instead of an assignment, like this:
Another bug is that table.getn() throws an exception for a 'new LuaTable()' that hasn't been used. It doesn't seem to properly check for null list/dict values.
These aren't big problems and they can be worked around, but I thought I'd mention them anyway.
Also, it would be nice to have a QuestEntryStateChanged event, with the quest and entry number; this might be a bit tricky with how BroadcastMessage() is currently used for sending dialogue events, but it would make detailed quest tracking easier. I've solved it for now by overriding the default SetQuestEntryState Lua function.
Thanks for an excellent asset.
Code: Select all
local foo = 4
for i = foo, 1, -1 do ... end
print(foo)
Code: Select all
for i = foo+1-1, 1, -1
These aren't big problems and they can be worked around, but I thought I'd mention them anyway.
Also, it would be nice to have a QuestEntryStateChanged event, with the quest and entry number; this might be a bit tricky with how BroadcastMessage() is currently used for sending dialogue events, but it would make detailed quest tracking easier. I've solved it for now by overriding the default SetQuestEntryState Lua function.
Thanks for an excellent asset.