S
Stratos.la
Guest
Hello yet again! im trying to make a dynamic ds_list with elements being added when conditions are met. i have a list with 3 initial elements and would like to add more after a level of when the character levels up. i have created a global variable and tried it with an if statement in the object that holds the list create event, but no luck, when i do it like this it overwrites the previous entries, which i understand since I'm changing the list. Any suggestions on how i should handle something like this is there a way to have a fixed number of elements in the list but without a value and set the value when the conditions are met?
so since i don't know my lists that well, am looking for a way to keep the last elements and add more when the global variable changes.
GML:
elements = ds_list_create();
if global.cardHoldings = 0
{
ds_list_add(elements, sCardArcher);
ds_list_add(elements, sCardMage);
ds_list_add(elements, CardsIndex);
}
else if global.cardHoldings = 1
{
ds_list_add(elements, sCardArcher);
}