How to detect a duplicate reward card?

Hi, I am creating a store in my game where the player can use coins to open crates. The crate randomly selects a texture from a slate brush array and applies it to an image in a widget. I want it where if the player gets a duplicate card from a crate, they receive coins but if the card is not a duplicate, it will not give the player coins. How do I do this? Any help will be appreciated, thanks.

Difficult to advise as you haven’t disclosed the most important bit of info.

  • A: Does the player get to keep the card? As in, can they navigate to their inventory and browse them again?
  • B: You just flash the card in front of the player and forget about it but still do not want to award them the same prize again?

If A, there’s quite a number of possibilities:

  • use AddUnique when addicting to the array, if this node returns -1, the array item already exists
  • loop through the array of owned cards and compare it to the one you’re adding - slate brushes/images can be directly compared
  • since the cards are unique, you can keep them in a Map, it accepts unique keys only. Int/SlateBrush Map should work here.

If B, keep track of the cards that have been displayed for the player. After you’ve selected a random one from the array, show and remove it so it no longer has a chance to be selected.

I managed to fix the problem. Somehow the event tick was causing the problem and I just had to put a do once node in front of all the nodes ahead of it. Now when the player gets a card for the first time, they receive no coins but if they get the card again, they receive coins.