Error claims a value is nil, which makes no sense
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
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.
Re: Error claims a value is nil, which makes no sense
Code: Select all
for i = 1, 20 do
table.insert(rX, love.math.random(100, 110))
table.insert(rY, love.math.random(100, 110))
table.insert(rS, love.math.random(1, 20))
end
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 use an algorithm that doesn't involves deleting elements mid-loop.
Re: Error claims a value is nil, which makes no sense
maybe i could just make an array that marks each table element to remove then do it after the loop finishes?raidho36 wrote: ↑Fri Sep 01, 2017 6:40 am 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 use an algorithm that doesn't involves deleting elements mid-loop.
Re: Error claims a value is nil, which makes no sense
You could do that, yes.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests