V
VediaTony
Guest
Heya!
As the title suggests, I'm getting a very strange bug when working with ds_list.
In my gameplay controller object that is persistent, I create a global ds_list in the CREATE event with the following code:
I also destroy the list within this object but this time it's in the Game End event, this is the code I use to destroy it:
Then I have a room that has 51 SAME objects inside it meaning they run the same code and everything, I proceed to insert these objects into global.LEVEL_LIST by using this code:
After all, objects get inserted into the ds_list another object comes called obj_level_manager that is not persistent. This object should loop through the list and make every object inside this list visible, this is also where the issue comes.
I don't use loops to go through the list instead I use alarm[0] (look at the code)
So firstly I get the global.LEVEL_LIST size by using this code (CREATE event):
list_size should be 50 but instead, it's 45.
Then we move to the alarm[0] code which is:
This basically loops through the ds_list sets every object in the list visible. The last line just checks if the current object isn't the last one continue looping.
As the title suggests, I'm getting a very strange bug when working with ds_list.
In my gameplay controller object that is persistent, I create a global ds_list in the CREATE event with the following code:
Code:
global.LEVEL_LIST = ds_list_create();
Code:
ds_list_destroy(global.LEVEL_LIST)
global.LEVEL_LIST = -1;
Code:
ds_list_add(global.LEVEL_LIST,id)
I don't use loops to go through the list instead I use alarm[0] (look at the code)
So firstly I get the global.LEVEL_LIST size by using this code (CREATE event):
Code:
list_size = ds_list_size(global.LEVEL_LIST)-1;
alarm[0] = 3;
Then we move to the alarm[0] code which is:
Code:
var tmp = ds_list_find_value(global.LEVEL_LIST,list_size)
tmp.visible = true;
list_size--;
if(list_size >= 0) alarm[0] = 3;