GML 2d array default value of non initialized rows

C

Celophisis

Guest
Hi everyone!

I am using Game Maker Studio 1.4 and I am wondering if there is any way to remove or set rows from a 2d array to the default state.

I am using the array_height_2d function as a condition for a for loop. However the height of the array is dynamically changing in game. That is not a problem when increasing the size of the array, but if a "remove" a value, let's say setting that particular row to -1, then the array_height_2d() function will not return the appropriate value.

Is there any way to actually remove a row from a 2d array in such a way that it will not be counted by the array_height_2d() function?

Thank you in advance.
 
C

Celophisis

Guest
Thank you! That was a very simple solution haha.
I just copy all of the data except the row I wanted to remove in a temporary array, then set my array to 0 and finally recover the values from the temporary array.
 
Top