Search found 24 matches
- Fri Sep 01, 2017 6:54 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Re: Error claims a value is nil, which makes no sense
I did a super basic test and it only errors after removing some table elements by attempting to index an out of range element, as I said. Because of the way your loop works, there's no way to set it up so it wouldn't crash. You will need to either manually check if the value is nil every time, or u...
- Fri Sep 01, 2017 5:41 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Re: Error claims a value is nil, which makes no sense
All I can say then, it doesn't show error screen unless there is an error. There is a nil in your tables somewhere. There is always nil past the range, and there could be one in the middle. for i = 1, 20 do table.insert(rX, love.math.random(100, 110)) table.insert(rY, love.math.random(100, 110)) ta...
- Fri Sep 01, 2017 2:31 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
- Fri Sep 01, 2017 2:00 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Re: Error claims a value is nil, which makes no sense
thats what i thought he meant, didnt work thoughSir_Silver wrote: ↑Fri Sep 01, 2017 1:47 am What raidho means is, instead of iterating from 1 to the # of your table, iterate from the # of your table to 1 stepping by -1:
Code: Select all
for i = #my_table, 1, -1 do end
- Fri Sep 01, 2017 2:00 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Re: Error claims a value is nil, which makes no sense
did that, same problem. it returns nil before table elements start getting removed
- Fri Sep 01, 2017 1:24 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
- Fri Sep 01, 2017 1:03 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Re: Error claims a value is nil, which makes no sense
So the problem is definitley in the `n` for loop. In other areas I replaced n with 1 and it ran fine. So the loop that does i works fine, but the exact same loop with a differnent letter doesnt work. This is really annoying
- Fri Sep 01, 2017 1:01 am
- Forum: Support and Development
- Topic: Error claims a value is nil, which makes no sense
- Replies: 14
- Views: 9616
Error claims a value is nil, which makes no sense
Everytime I attempt to run my code I get an error that says a value in my if statement is nil. The if statement in question: elseif rX[i] < rX[n] + 2 and rX[n] < rX[i] + 2 and rY[i] < rY[n] + 2 and rY[n] < rY[i] + 2 then Ive managed to narrow it down to it thinking that rX[n] is nil. The absolutely ...
- Tue Aug 29, 2017 12:47 pm
- Forum: Support and Development
- Topic: How would I go about drawing the same object multiple times?
- Replies: 10
- Views: 9319
Re: How would I go about drawing the same object multiple times?
When you try to access an index of a table whose value is nil,, if that table has a metatable which has an __index metamethod, it will invoke the __index metamethod. Here's what happens without the use of a metatable: local my_table = {} print(my_table[1]) --prints nil, because there is no value at...
- Tue Aug 29, 2017 12:43 pm
- Forum: Support and Development
- Topic: Strange issue - my function always thinks it is selecting something when im not
- Replies: 7
- Views: 4315
Re: Strange issue - my function always thinks it is selecting something when im not
Would you be so kind as to upload a .love file of your game, it would be much easier to debug that way. If you aren't sure how to do that, you just have to zip up your main.lua with any other files you have and rename the .zip to .love everything is super unstructured and spelled wrong just ignore ...