Page 2 of 2

Re: Error With Object Oriented Things

Posted: Wed Mar 28, 2018 7:18 pm
by zorg
Just a blind guess, but i think it may be the issue, you're not math.floor-ing the map (and emap) indexing code after you divide the grid coordinates with 32; usually it wouldn't be an issue, but double indexing errors out if you try to do [nil][anything], which you might be, given the previous reasoning. (it's not integer division, and you don't have fractional array values defined)

Math floor the self.grid / 32 expressions inside the []-s, and maybe it will work.

Re: Error With Object Oriented Things

Posted: Wed Mar 28, 2018 7:38 pm
by pgimeno
I forgot to specify, sometimes instead of [ ] it's the . operator the one producing the error (which is another notation for the same thing).

Also, what zorg said.

Also, Windows users normally don't think of using print() as a debugging tool, because they don't have a console to look at the output. Opening Löve from the console as a console application (is lovec.exe still a thing?) will allow you to view the output of print() commands, which are priceless for debugging and finding out what values are causing problems.

Re: Error With Object Oriented Things

Posted: Wed Mar 28, 2018 7:53 pm
by NotARaptor
On Windows you can force a console to appear by editing the conf.lua file. Print is invaluable for debugging :)

Re: Error With Object Oriented Things

Posted: Thu Mar 29, 2018 12:13 am
by zorg
Both the conf.lua setting (and you should define your conf.lua-s as well!) and using lovec.exe is recommended! :3