C
Christian Krupa
Guest
Hi all,
my first post here, stuck on a strange error that I can't google my way out of
randomize() // make random events truly random
deck = global.ingredient_deck; //assign the set deck to the variable deck
decksize = array_height_2d(deck); // get the size of the starting set deck
shuffle_deck=ds_list_create(); // create a list to hold the deck in order to shuffle it
// fill the list with values to represent the indexes in the set deck
for (i=0;i<decksize;i++){
shuffle_deck = i
show_debug_message(shuffle_deck);
}
// shuffle that list
ds_list_shuffle(shuffle_deck);
spice_bag = ds_stack_create(); // create a stack to load the shuffled values into
for (i=0;i<decksize;i++){
spice_bag = shuffle_deck;
}
I'm getting an error on the ds_list_shuffle function as follows
ds_list_shuffle argument 1 incorrect type (2) expecting a Number (YYGI32)
at gml_Object_obj_bag_CreateEvent_1 (line 15) - ds_list_shuffle(shuffle_deck);
The rest of the code seems to work and even transfers the ds_list into the ds_stack,
sorry if this is a silly newb thing,
thanks
Chris
my first post here, stuck on a strange error that I can't google my way out of
randomize() // make random events truly random
deck = global.ingredient_deck; //assign the set deck to the variable deck
decksize = array_height_2d(deck); // get the size of the starting set deck
shuffle_deck=ds_list_create(); // create a list to hold the deck in order to shuffle it
// fill the list with values to represent the indexes in the set deck
for (i=0;i<decksize;i++){
shuffle_deck = i
show_debug_message(shuffle_deck);
}
// shuffle that list
ds_list_shuffle(shuffle_deck);
spice_bag = ds_stack_create(); // create a stack to load the shuffled values into
for (i=0;i<decksize;i++){
spice_bag = shuffle_deck;
}
I'm getting an error on the ds_list_shuffle function as follows
ds_list_shuffle argument 1 incorrect type (2) expecting a Number (YYGI32)
at gml_Object_obj_bag_CreateEvent_1 (line 15) - ds_list_shuffle(shuffle_deck);
The rest of the code seems to work and even transfers the ds_list into the ds_stack,
sorry if this is a silly newb thing,
thanks
Chris