Pfap
Member
I am creating a list in a script and filling it with data, which I later access from an object. I don't get the error when accessing from the script, but later in the object it crashes.
Compile output:
And this is the object code:
Does anybody have any ideas as to what is going on here?
Sometimes I feel like I am eating crazy pills.
Compile output:
Here is the script which has the debug messages shown on the first 2 lines in the quote above:ds_list_find_value(global.opponent_card_list,0)
13
ERROR!!! :: ############################################################################################
ERROR in
action number 1
of Create Event
for object opponent_cards:
Data structure with index does not exist.
at gml_Object_opponent_cards_Create_0 (line 7) - var start_one = ds_list_find_value(global.opponent_card_list,0);
############################################################################################
Code:
global.opponent_card_list = ds_list_create();
//grab the initial 3 cards
ds_list_add(global.opponent_card_list,ds_list_find_value(card_net_list,0));
ds_list_add(global.opponent_card_list,ds_list_find_value(card_net_list,1));
ds_list_add(global.opponent_card_list,ds_list_find_value(card_net_list,2));
ds_list_destroy(card_net_list);
show_debug_message("ds_list_find_value(global.opponent_card_list,0)");
show_debug_message(ds_list_find_value(global.opponent_card_list,0));
Code:
//it crashes here, but not in the script above where I make the same call
var start_one = ds_list_find_value(global.opponent_card_list,0);
var start_two = ds_list_find_value(global.opponent_card_list,1);
var start_three = ds_list_find_value(global.opponent_card_list,2);
var ytsart = top_line_opp_draw.y+16;
//create the initial 3 cards
instance_create_depth(left_line.x-72,ytsart,-1000,start_one);
instance_create_depth(left_line.x-72,ytsart+64,-1000,start_two);
instance_create_depth(left_line.x-72,ytsart+128,-1000,start_three);
Does anybody have any ideas as to what is going on here?
Sometimes I feel like I am eating crazy pills.