I've gone through the manual but I wasn't successful in figuring out the correct way of refilling a ds list with its original values.
Suppose I have object Bob and Bob starts off with say, 3 apples 2 bananas, 1 cherry. I'd like to make it so that when all fruits have been used up (using ds_list_delete) Bob again gets 3 apples, 2 bananas, 1 cherry. I thought the copying functions might work, but nothing happens.
Here is what I have:
Create Event:
Key Press Event:
Thank you in advance.
Suppose I have object Bob and Bob starts off with say, 3 apples 2 bananas, 1 cherry. I'd like to make it so that when all fruits have been used up (using ds_list_delete) Bob again gets 3 apples, 2 bananas, 1 cherry. I thought the copying functions might work, but nothing happens.
Here is what I have:
Create Event:
Code:
fruit_list_source=ds_list_create();
//Bob
ds_list_add(fruit_list_source,
app,
app,
app,
ban,
ban,
chr,
)
fruit_list_main = ds_list_create();
ds_list_copy(fruit_list_main, fruit_list_source);
;
Code:
if ds_list_size(fruit_list_main)>0
{ds_list_delete(fruit_list_main,0)}
else
{
ds_list_destroy(fruit_list_main);
fruit_list_main = -1;
fruit_list_main = ds_list_create();
ds_list_copy(fruit_list_main, fruit_list_source);
}