Been using Unity for my gui project until one day I noticed simple actions caused the program's memory usage to suddenly and uncontrollably begin rising. So today I've switched over (or yesterday anyway) and so far so good. However I've a few queries:
• I can't access index 0 of my tables anymore (ie. lua string$("DRAW.0.DrawType") won't work). I could before; should I change things to start at 1 instead or is this something needing fixing?
• I used Unity's message queue to pass values from LUA to DBPRO as it was far faster than reading out of the tables DBPRO side. Is there some kind of equivalent here, or how else could I get some speed back?
• All my variables are declared inside a function. Unity was happy with this, but this plugin says they are not global (ie. "ENTRY is not a global string"). Rework or is there a way to global-ise them? I thought they were all global unless otherwise stated. :S
Other than that, liking it so far.
Edit: Done a bit of research. Still not sure about table index 0's, but otherwise:
• Will switch to directly calling the DBPRO drawing functions from LUA in absence of the message queue. I imagine this will be even faster than it was before.
• My string-not-global problem stemmed from this DBPRO line,
lua set string "ENTRY", entry$()
Interestingly, everything has been fixed with
lua set string "ENTRY", entry$() + ""
So question is, is this a DBPRO or a LUA bug?
Ta!
Edit 2: Another problem, related to the last. This lua code:
DBPro.Call("LUA_DRAW_PRINT", paramValue)
would crash the program once I started deleting objects from my GUI. I changed it to this:
if paramValue ~= "" and paramValue ~= nil then DBPro.Call("LUA_DRAW_PRINT", paramValue) end
but the problem persisted. Then on a whim I changed it to this:
if paramValue ~= "" and paramValue ~= nil then DBPro.Call("LUA_DRAW_PRINT", paramValue .. "") end
and once again, that empty string addition has solved it. How, I have no clue. I'm guessing an oversight in parsing or some'etes?
Additional Ta!