Posted by member 12025 on 2006-12-27 00:35:48 link
The for loop doesn't work. It acts just as if I has done it after LSLua has loaded (it doesn't monitor _G, that or it only does so before lslua.init () runs). I made the ifs one-liners, though.
Note that such a for loop seems to work just find outside of the module file itself. I think it has to do with the module spec and trying to mess with _G. FI, your loop as you have it works, where mine, using the variables as stated, does not. But, I don't want to waste so many functions, nor make there be multiple "name" or "count" variables (the top one is deprecated).
To be more specific, for i=1,250 do works, but for i=1,_G.__rentbangs__count do does not.
If I do is as for i=1,__rentbangs__count do, with no _G, it gives an error that the limit must be a number (it is is I try to access it later--outside the module).
If I use the module's "count", or set the __ one inside it, I get no error, but again, it does not work. So I can have the many lines, or have it check _G, or do the bang definitions outside the module, based on what I've tried so far. I could also iterate through _G with pairs(), but I just don't like that solution in general, as it does mean going through all of _G, for all practical purposes.
Note that such a for loop seems to work just find outside of the module file itself. I think it has to do with the module spec and trying to mess with _G. FI, your loop as you have it works, where mine, using the variables as stated, does not. But, I don't want to waste so many functions, nor make there be multiple "name" or "count" variables (the top one is deprecated).
To be more specific, for i=1,250 do works, but for i=1,_G.__rentbangs__count do does not.
If I do is as for i=1,__rentbangs__count do, with no _G, it gives an error that the limit must be a number (it is is I try to access it later--outside the module).
If I use the module's "count", or set the __ one inside it, I get no error, but again, it does not work. So I can have the many lines, or have it check _G, or do the bang definitions outside the module, based on what I've tried so far. I could also iterate through _G with pairs(), but I just don't like that solution in general, as it does mean going through all of _G, for all practical purposes.