Closed ACIDULATED closed 2 years ago
I think I need more info. What does your file structure look like?
I have my images (kris(number).png) in data folder with main.lua. That's about it.
Looking at your code again, I think you missed a tostring() statement on line 5. It should read like this:
for i = 1, 4 do
table.insert(frames, love.graphics.newTexture("kris" .. tostring(i) .. ".png"))
end
The error shouldn't return to the homebrew menu though, it should just show the normal error screen. See if this helps anyway.
I have my images (kris(number).png) in data folder with main.lua. That's about it.
kris????
While I really have no say in this at all, its usually a good idea to keep stuff like this serious, but again this is just my two cents.
Looking at your code again, I think you missed a tostring() statement on line 5.
Concatenation should work automatically with numbers in Lua without needing a string converter, since that behaviour is defined in the Lua docs:
Lua denotes the string concatenation operator by ".." (two dots). If any of its operands is a number, Lua converts that number to a string.
Doing
the = 1
theThing = "the thing "
print(theThing + the)
Gives the error main.lua:3: attempt to perform arithmetic on a string value
doing tostring(the)
does not give this error
Looking at your code again, I think you missed a tostring() statement on line 5.
Concatenation should work automatically with numbers in Lua without needing a string converter, since that behaviour is defined in the Lua docs:
Lua denotes the string concatenation operator by ".." (two dots). If any of its operands is a number, Lua converts that number to a string.
Interesting, might have to look into this more then.
doing tostring(the) does not give this error
String concatenation in Lua is more officially done with the double-dot syntax, as the issue author has done in their original code. The Lua interpreter I have installed currently outright rejects concatenation of strings with +, even when both variables are strings.
doing tostring(the) does not give this error
String concatenation in Lua is more officially done with the double-dot syntax, as the issue author has done in their original code. The Lua interpreter I have installed currently outright rejects concatenation of strings with +, even when both variables are strings.
ah ok cuz i swear the same thing happened with me with .. but ig i just got to used to writing tostring()
Fixed in 2e7b7fe19fe47d7f616949db771b2813ff62af8f
title says it all. btw, i think a discussions page would be really helpful so nobody has to post every single coding issue they have in the issues page.