Card Dealing problem

Hi, thanks in advance for reading and taking your time in helping me.

I’m making a card game, like Slay The Spire. At the beginning of the scene, I deal 5 random cards (now you see the “Pick Random” function but I already used structures and arrays).

So, when i click my “End Turn” button, I reinitialize the counter variables and “replay” the same code, but the screen freezes and it doesn’t deal any card.

I can’t get why it doesn’t work.

Are you using different code to do the first deal? Unless this is a subevent, it looks like it would delete all of the cards both used and unused. In the first group, I would add Boolean value of variable Used of object Carta is True to pick only the used Carta and in its action, you would have to add Pick all instances of Carta. Otherwise, the Carta instances wouldn’t be available to be picked in the subevent. Conditions work like filters. Anything that’s not picked in the first event wouldn’t be available in its subevents. So, you need to pick everything.

1 Like

That’s awesome. Yes it does delete all cards… i was so blind! Thanks for your help Keith!! it’s working with 10 cards, i’m getting the correct ones after clicking “end turn”.

1 Like