Closed vincentducorps closed 9 years ago
This has been discussed before, please put your variables in your ScriptThread table.
Sorry to re-open this discussion but I don't understand why and how... :S
For example, I have the classic main.lua and I want to include a second config.lua file that contains a variable. If it's "local", I could'nt use it in my file main.lua This requires that I put in the "global" but then it pollutes space
Just store the variables in your thread table. thread_table = ScriptThread("thread_table")
So I would have to use ScriptThread table every time for each variable / function? And use 'self' to access
Why not use lua modules, as this is done to avoid this?
Too much work?
Yes.
And it was a personal design choice :) It's not about the work.
Hi,
If I use a global variable in my script, it affects all other scripts!
Perhaps using Lua module functions ?