More than 60 upvalues madness!

I’m working with arrays to NOT get into trouble with the “more than 60 upvalues” problem…

but now somehow I have the error and can’t get it fixed.

I have created an array like this:

local func={function1,function2,…}

and later are creating the functions…

func.function1 = function()

end

So what can cause the problem? Is it possible to have to many entries in the func array? I thought I can enter a lot of names… or is there also a limit like the 60 upvalues?

Where can I get the info how to look into the error problem?

The message reads like: level.lua: 8000: function at line 153 has more than 60 upvalues

What exactly does this mean? Everything inside the function is too much or the predefined stuff outside of the function?

Any help welcome!

The most common case when I get this message, which kept me scratching my head up to the point where I started to remember about it, is a missing “end” at some point in code.

Other than that, i have only come across this problem once, in a huge function. I soved it by creating sub functions within it.

I assume you have googled then meaning of max 60 upvalues so there I dont know more than you.

Perhaps one of the experts can explain it better.

THANK YOU!

There was an “end” missing! :slight_smile:

The most common case when I get this message, which kept me scratching my head up to the point where I started to remember about it, is a missing “end” at some point in code.

Other than that, i have only come across this problem once, in a huge function. I soved it by creating sub functions within it.

I assume you have googled then meaning of max 60 upvalues so there I dont know more than you.

Perhaps one of the experts can explain it better.

THANK YOU!

There was an “end” missing! :slight_smile: