Originally Posted by Grimsin
local Party1CurrHealth, Party1MaxHealth = UnitHealth("Party1"), UnitHealthMax("Party1") --- does this count as two locals jammed into one? since im not actually using the word local again?
|
No you then have two upvalues.
blah that thread is only somewhat helpful.
|
That thread explains exactly whats going wrong.
Heres a quick example of the number of upvalues your using
lua Code:
local local1, local2 = "blah", "blah"
--At this point you have 2 upvalues
do
local local3 = "blah"
--at this points there are 3 upvalues
end
--Now we're back to two again
local function func(arg1, arg2, arg3)
--When this function is called we have 5 upvalues
--here we only have access to local1, local2 and the args (arg1, arg2 and arg3)
end
--Only two upvalues here local1 and local2
func("blah", "blah", "blah")
--Back to two upvalues again local1 and local2
mytable = {}
--number of upvalues still at 2 because mytable is stored in the Global table _G
mytable.var = "blah"
--number of upvalues still at 2
This is the best example I can give of why it's breaking.
Now if at any point in your code the upvalue count reaches more than 60 then you'll get your error.
Ways to avoid this include separating your code into sensible blocks, or by storing more of your variables in tables.