Hello! I've started receiving an error.. It says: "function at line 1722 has more than 60 upvalues". I checked the function at line 1722, and it's my largest function in the code. It's the pause function and it contains lots of smaller functions in it, if I remove one of these nested functions the code works, but if I add it back it gives me the error again..
Is there any way to solve this? I can't remove any of the functions in there, it will ruin the game..
Thanks in advance,
Whenever I get that, it's from missing an "end" at the bottom of the function
@Vandano, it's not that because if I remove two if-statements from the pause function it suddenly works again..
I have the same errors, could someone help? !
As Vandano said, if I remove someline within it ( less than 60) it works.. where is the limits from?
Thanks
60 is an internal limit in Lua itself.
This World of Warcraft thread has a good discussion on this:
http://wow.incgamers.com/forums/showthread.php?t=414407
For a workaround to the original problem, I would suggest either making some of your functions global, or possibly putting some of your functions inside a common local table (so the table will only count as 1 upvalue).
@ewing Thanks for the link, really enlightening!
Totally enlightening! I now see the need for sparingly use forward declarations.