First my code (in Ace):
g = 6 @t = [] for i in 0..g-1 for j in 0..g-1 @t[[j]] = Sprite.new() # line of the error @t[[j]].bitmap = Cache.system("dirt0") @t[[j]].z = 150 @t[[j]].x = 16*i @t[[j]].y = 16*j end endMy goal here is to create a simple grid of dirt0 sprites (this runs in a Window_Base). I've used this same logic process several times in other engines so thats not what I'm worried about, nor is it the problem. The problem I run into is when we reach the Sprite.new line and it throws a "no implicit conversion from nil to integer" error. This also occurs when I attempt to store any other type in the array.
I can store whatever I need outside the for loops, which leads me to believe that they are part of the issue but I am not sure how.
I'm no Ruby master but in no case do I find myself calling for a conversion or anything else suggested by the message which adds to my confusion.
g = 6 @t = [] for i in 0..g-1 for j in 0..g-1 @t[[j]] = Sprite.new() # line of the error @t[[j]].bitmap = Cache.system("dirt0") @t[[j]].z = 150 @t[[j]].x = 16*i @t[[j]].y = 16*j end endMy goal here is to create a simple grid of dirt0 sprites (this runs in a Window_Base). I've used this same logic process several times in other engines so thats not what I'm worried about, nor is it the problem. The problem I run into is when we reach the Sprite.new line and it throws a "no implicit conversion from nil to integer" error. This also occurs when I attempt to store any other type in the array.
I can store whatever I need outside the for loops, which leads me to believe that they are part of the issue but I am not sure how.
I'm no Ruby master but in no case do I find myself calling for a conversion or anything else suggested by the message which adds to my confusion.