🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LUA Code Organization

Started by
1 comment, last by Muse 20 years ago
Hi, how does one organize LUA code, so that, the variables i globally create in one Lua Script are not seen in another. Am I forced to create a function to encapsulate those variables, so that they aren't seen from the "outside" (global)? Is there a way to kill a variable, something like: undefine var; ?
Advertisement
Wouldn't setting the var to "nil" be enough?

You could also have more than one lua context.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

If you just declared your variables with 'local' in a script but outside of any specific chunk they'd be visible to everything in the script but not between scripts, I believe.
Is that what you were wondering?
-david

This topic is closed to new replies.

Advertisement