When testing my codes,an error occured and I dont know why...
So I am here again to ask for good souls' help... =_=
The error message in console is:
lua:513:exception indexing '20'(the number changes each time, '20'or'35'or'2'or...)
Codes:
function LevelSetup()
...
...
SeedlingsInBattle={}
for i=0,GetNumAsteroids()-1 do
SeedlingsInBattle[i]={}
for j=0,11 do
SeedlingsInBattle[i][j]={}
end
end
end
function LevelLogic()
...
...
while GameRunning() do
for i=0,GetNumAsteroids()-1 do--check each asteroid
local a=GetAsteroid(i)
if a:GetNumSeedlingsExcluding(a.Owner)>0 then--check if there are other factions' seedlings on the asteroid,which means the battle begins or continues
for j=0,11 do--check each faction
if a:GetNumSeedlings(j)>0 then
for count=0,a:GetNumSeedlings(j)-1 do
SeedlingsInBattle[i][j][count]=a:Seedlings(j)[count]--*****Here is line 513*****
end
end
end
end
end
...
...
coroutine.yield()
end
...
...
end
=_=,Whats wrong with "SeedlingsInBattle[\i][j][count]=a:Seedlings(j)[count-1]" ?
By the way,it's been a while since I saw Alex and Rudolf online last time...
So busy you two are, but dont forget to take a rest.