A Vague Question...?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
dizzykiwi3
Citizen
Posts: 58
Joined: Tue Jan 14, 2014 2:03 am

A Vague Question...?

Post by dizzykiwi3 »

So I went ahead and made the mistake of implementing a big feature with multiple components without testing and building slowly. So now I'm stuck bug fixing this kind of rickety thing.

My current issue that's kind of abstract, that I'm hoping someone has encountered before, or can interpret what I fail to see is this error:

attempt to perform arithmetic on local 'parametername' (a table value)

What's supposed to be happening is that I'm passing a value of a table (e.g. tab.x) into a function, which I know is perfectly fine to do, so does anyone know exactly what that error means in layman's terms? Am I accidentally passing a table and performing arithmetic on it or is there some specific lua issue I'm missing?
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: A Vague Question...?

Post by Kingdaro »

That's exactly what's happening. It's trying to do math with a table (e.g. tableValue + 5), but, for obvious reasons, cannot. The error specifies that it's a local variable, so it's either an argument or defined locally within the function itself.
User avatar
dizzykiwi3
Citizen
Posts: 58
Joined: Tue Jan 14, 2014 2:03 am

Re: A Vague Question...?

Post by dizzykiwi3 »

So how can I get around this? What exactly is the difference between a table value and the value itself?
User avatar
dizzykiwi3
Citizen
Posts: 58
Joined: Tue Jan 14, 2014 2:03 am

Re: A Vague Question...?

Post by dizzykiwi3 »

Am I misunderstanding what a table value is? Is a table value this:
> print(t)
table: 0035AE18
or the value of a key within a table?
User avatar
dizzykiwi3
Citizen
Posts: 58
Joined: Tue Jan 14, 2014 2:03 am

Re: A Vague Question...?

Post by dizzykiwi3 »

God dammit I was passing a table, right at the very top of the chain, god dammit xD thanks for help clarifying it
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests