Closed magarcan closed 5 years ago
Oh? That's a new one. I'll take a look at it when I get a chance.
Okay, did you try clicking on the error and examining the line where the assertion took place? This is what it looks like:
func set_cell(p_row: int, p_col: int, p_value):
assert has_cell(p_row, p_col)
data[p_row][p_col] = p_value
You attempted to set a cell to a value where the cell itself did not yet exist. Likely reasons for this error occurring are...
You forgot to initialize the dimensions of the 2-dimensional array using resize()or
resizev()` before setting a cell.
arr.set_cell(1, 1, "hello") # errors?
arr.resize(2, 2) # guarantees that cell (1, 1) exists
arr.resizev(Vector2(2, 2)) # same
arr.set_cell(1, 1, "hello") # now won't error
You ran a loop over a row or column that did not yet exist and your count is off so your iteration index is attempting to dereference an array cell that hasn't been defined.
for i in 3:
for j in 3:
arr.set_cell(i, j, "hello") # errors?
# to fix, either adjust i and j bounds to fall within the array size OR
# resize the Array2D to include the size of the bounds (so they don't fail).
As far as I can tell, this is a user error. I'll leave it open for a little longer, so that you can have a chance to re-examine your code and confirm things, but then I'll close the Issue.
If an assertion is caught, be sure to examine the code itself to get an idea of why the error occurred.
Okay, it's been a week and I haven't heard from you. As far as I can tell, this Issue is related to user-error. I will close it for now. Let me know if you have any further questions about this.
Just imported the library within Godot 3.1.1. Have the following error in line 30: Assertion failed.