View Single Post
04-18-09, 01:47 AM   #33
Azul
Banned
 
Azul's Avatar
Join Date: Apr 2009
Posts: 19
Originally Posted by Pytlask View Post
What programming languages have you used previously? We may be able to provide parallels to make this easier for you to understand.

As far as I know though, all of the popular ones use a similar scoping mechanism to Lua. The primary difference is that most languages default to local scoping while Lua defaults to global scoping.

The following are essentially equivalent:

Lua:
Code:
do
	local varName = 1;
end
C/C++:
Code:
do {
	int varName = 1;
}
Python:
Code:
def aFunc ():
	varName = 1
It seems to me that you are confusing the Lua "local" keyword with the C/C++ "static" keyword.

Edit: If you need 60 local variables, you are doing something wrong. Is there a reason you can't just show us the code you have right now so that we might suggest a better method?
I've never encountered any scripting or programming languages that have a 60 variable limit. This is the first time.



There's really nothing interesting to see in my code. I just have a lot of variables. Some of them could be condensed by an efficient bitmasking operation, but it seems Lua only has extremely slow function based ones.

Originally Posted by yssaril View Post
idk then without looking at actual code there is not much we can help other to say that you cant have more than 60 (i believe it has something to do with how local are stored memory wise in lua same thing that also makes them fast)

also may i ask what are you Checking OnUpdate that requires more than 60 values just sounds inefficient to me to start with
What do you hope to see? And why? It's completely irrelevant to the question at hand. All I'm asking for a way to have >60 local variables. I'm not sure what more information is needed then that.
If you think there's some easy way to "fix" my code to not need this many values.. trust me, there isn't.

Last edited by Azul : 04-18-09 at 01:50 AM.