About BlackJack template

Hi, Im going mad trying to understand all blueprints in the blackjack example to build a card game but time will get me there. Until then, there is something is driving me crazy.

What is the purpose of this sequence?

Crazy or trully dumb, I don’t know anymore, the case, is that needs to be there, if I bypass it crazy things happends, but I can’t get why. Any help?

BTW, the blueprint is BP_Logic and the function “CalculateCardValue”, although I have seen it somewhere else too.

Nevermind, I was brainloaded and didn’t get it right. Just need some rest and with time I finally got it.

The division and multiplication is made over integers, so in a clever way, 1st they divided by the total number of cards, and as it being an integer, the result has no decimals, 2nd they multiply again by total number of cards and subtract it from the original value. Long history short, as divide and multiply as integer you get the total number of cards in previews decks, then you subtract it to the original value and you get the ID as if you only have 1 deck, then you do the same for the suits and you have it.

The true is that this example is not well documented and maybe it’s not optimal, I have been cleaning blueprints and redoing some connections to improve gameplay and understanding, which help me a lot.

Hopes this explanation helps others and please don’t hesitate in correct me if I’m wrong or if I made some mistakes as explaining it.