I’m trying to create a deck of cards. The problem is that when I remove it, there’s nothing left. At the first click to find the card, I go from 5 to 4 then after I stay to 4
every time you call the function you reset the array to the DataTableRowNames.
basically youre filling the array, removing one, refilling the array etc
what you should do is have 2 arrays. (AllCards and AvailableCards)
on beginplay Set AllCards to DataTableRowNames and AvailableCards to AllCards then Shuffle the AvailableCards.
on RandomCard check if AvailableCard is not empty and get a copy(0) (no need to randomise as its already shuffled) then remove index(0)
if empty, reshuffle (set AvailableCards to AllCardsShuffled)
close, dont ‘RemoveIndex’ before ‘Get’ using it (discard card before drawn)
no need to set after a shuffle.
on your false path after shuffle just call RandomCard
Sorry, I don’t understand what you mean by.
close, dont ‘RemoveIndex’ before ‘Get’ using it (discard card before drawn)
just look at your top branch path,
remove index does exactly that, so when you next try to Get that index it isnt there anymore.
you cant remove the index until after your GetDataTableRow