Card Shuffle

InvaiderZim

New Member
Reaction score
2
I have a some what of a simple problem that alot of you have the experience to solve. I'm trying to make a deck of cards. Then shuffle the cards and deal them out to the players. I made the deck, i shuffled the deck, but when i deal the cards, i cant change the owner of the cards to match the suits.

For example: I would like Hearts to be Red, Diamonds to be pink, etc...

Here is what i got so far:

Trigger:
  • Deck
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Number_of_Cards = 52
      • Set The_Deck[1] = 2 Heart
      • Set The_Deck[2] = 3 Heart
      • Set The_Deck[3] = 4 Heart
      • Set The_Deck[4] = 5 Heart
      • Set The_Deck[5] = 6 Heart
      • Set The_Deck[6] = 7 Heart
      • Set The_Deck[7] = 8 Heart
      • Set The_Deck[8] = 9 Heart
      • Set The_Deck[9] = 10 Heart
      • Set The_Deck[10] = Jack Heart
      • Set The_Deck[11] = Queen Heart
      • Set The_Deck[12] = King Heart
      • Set The_Deck[13] = Ace Heart
      • Set The_Deck[14] = 2 Diamond
      • Set The_Deck[15] = 3 Diamond
      • Set The_Deck[16] = 4 Diamond
      • Set The_Deck[17] = 5 Diamond
      • Set The_Deck[18] = 6 Diamond
      • Set The_Deck[19] = 7 Diamond
      • Set The_Deck[20] = 8 Diamond
      • Set The_Deck[21] = 9 Diamond
      • Set The_Deck[22] = 10 Diamond
      • Set The_Deck[23] = Jack Diamond
      • Set The_Deck[24] = Queen Diamond
      • Set The_Deck[25] = King Diamond
      • Set The_Deck[26] = Ace Diamond
      • ETC....


Trigger:
  • Suffle Deck
    • Events
      • Player - Player 1 (Red) types a chat message containing -s as An exact match
      • Player - Player 2 (Blue) types a chat message containing -s as An exact match
      • Player - Player 3 (Teal) types a chat message containing -s as An exact match
      • Player - Player 4 (Purple) types a chat message containing -s as An exact match
    • Conditions
    • Actions
      • Trigger - Run Deck <gen> (ignoring conditions)
      • For each (Integer A) from 1 to 52, do (Actions)
        • Loop - Actions
          • Set Temp_Int = (Random integer number between 1 and 52)
          • Set Shuffled_Deck[(Integer A)] = The_Deck[Temp_Int]
          • Set The_Deck[Temp_Int] = The_Deck[Number_of_Cards]
          • Set Number_of_Cards = (Number_of_Cards - 1)
      • Trigger - Run Deal Cards <gen> (ignoring conditions)


Trigger:
  • Deal Cards
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Shuffled_Deck[1] for Player 1 (Red) at (Center of First Card <gen>) facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Last created unit)) Equal to 2 Heart
          • (Unit-type of (Last created unit)) Equal to 3 Heart
          • (Unit-type of (Last created unit)) Equal to 4 Heart
          • (Unit-type of (Last created unit)) Equal to 5 Heart
          • (Unit-type of (Last created unit)) Equal to 6 Heart
          • (Unit-type of (Last created unit)) Equal to 7 Heart
          • (Unit-type of (Last created unit)) Equal to 8 Heart
          • (Unit-type of (Last created unit)) Equal to 9 Heart
          • (Unit-type of (Last created unit)) Equal to 10 Heart
          • (Unit-type of (Last created unit)) Equal to Jack Heart
          • (Unit-type of (Last created unit)) Equal to Queen Heart
          • (Unit-type of (Last created unit)) Equal to King Heart
          • (Unit-type of (Last created unit)) Equal to Ace Heart
        • Then - Actions
          • Do nothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Last created unit)) Equal to 2 Diamond
          • (Unit-type of (Last created unit)) Equal to 3 Diamond
          • (Unit-type of (Last created unit)) Equal to 4 Diamond
          • (Unit-type of (Last created unit)) Equal to 5 Diamond
          • (Unit-type of (Last created unit)) Equal to 6 Diamond
          • (Unit-type of (Last created unit)) Equal to 7 Diamond
          • (Unit-type of (Last created unit)) Equal to 8 Diamond
          • (Unit-type of (Last created unit)) Equal to 9 Diamond
          • (Unit-type of (Last created unit)) Equal to 10 Diamond
          • (Unit-type of (Last created unit)) Equal to Jack Diamond
          • (Unit-type of (Last created unit)) Equal to Queen Diamond
          • (Unit-type of (Last created unit)) Equal to King Diamond
          • (Unit-type of (Last created unit)) Equal to Ace Diamond
        • Then - Actions
          • Unit - Change ownership of (Last created unit) to Player 8 (Pink) and Change color
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Last created unit)) Equal to 2 Club
          • (Unit-type of (Last created unit)) Equal to 3 Club
          • (Unit-type of (Last created unit)) Equal to 4 Club
          • (Unit-type of (Last created unit)) Equal to 5 Club
          • (Unit-type of (Last created unit)) Equal to 6 Club
          • (Unit-type of (Last created unit)) Equal to 7 Club
          • (Unit-type of (Last created unit)) Equal to 8 Club
          • (Unit-type of (Last created unit)) Equal to 9 Club
          • (Unit-type of (Last created unit)) Equal to 10 Club
          • (Unit-type of (Last created unit)) Equal to Jack Club
          • (Unit-type of (Last created unit)) Equal to Queen Club
          • (Unit-type of (Last created unit)) Equal to King Club
          • (Unit-type of (Last created unit)) Equal to Ace Club
        • Then - Actions
          • Unit - Change ownership of (Last created unit) to Player 11 (Dark Green) and Change color
        • Else - Actions
 

jig7c

Stop reading me...-statement
Reaction score
123
Trigger:
  • Deal Cards
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Shuffled_Deck[1] for Player 1 (Red) at (Center of First Card <gen>) facing Default building facing degrees
      • Set Card = Last Created Unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Conditions (or) And - Condition statement, it defaults to and condition if you leave it blank
            • (Unit-type of (Unit) Equal to 2 Diamond
            • (Unit-type of (Unit) Equal to 3 Diamond
            • (Unit-type of (Unit)) Equal to 4 Diamond
            • (Unit-type of (Unit)) Equal to 5 Diamond
            • (Unit-type of (Unit)) Equal to 6 Diamond
            • (Unit-type of (Unit)) Equal to 7 Diamond
            • (Unit-type of (Unit)) Equal to 8 Diamond
            • (Unit-type of (Unit)) Equal to 9 Diamond
            • (Unit-type of (Unit)) Equal to 10 Diamond
            • (Unit-type of (Unit)) Equal to Jack Diamond
            • (Unit-type of (Unit)) Equal to Queen Diamond
            • (Unit-type of (Unit)) Equal to King Diamond
            • (Unit-type of (Unit)) Equal to Ace Diamond
        • Then - Actions
          • Unit - Change ownership of (Unit) to Player 8 (Pink) and Change color
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Conditions (or) And - Condition statement, it defaults to and condition if you leave it blank
            • (Unit-type of (Unit)) Equal to 2 Club
            • (Unit-type of (Unit)) Equal to 3 Club
            • (Unit-type of (Unit)) Equal to 4 Club
            • (Unit-type of (Unit)) Equal to 5 Club
            • (Unit-type of (Unit)) Equal to 6 Club
            • (Unit-type of (Unit)) Equal to 7 Club
            • (Unit-type of (Unit)) Equal to 8 Club
            • (Unit-type of (Unit)) Equal to 9 Club
            • (Unit-type of (Unit)) Equal to 10 Club
            • (Unit-type of (Unit)) Equal to Jack Club
            • (Unit-type of (Unit)) Equal to Queen Club
            • (Unit-type of (Unit)) Equal to King Club
            • (Unit-type of (Unit)) Equal to Ace Club
        • Then - Actions
          • Unit - Change ownership of (Unit) to Player 11 (Dark Green) and Change color
        • Else - Actions

try that trigger!
 

mathiashl

New Member
Reaction score
0
Hay guys i,d made about 3 i think card shuffles and its easy.
Put the items into regions (one region full of items = 1 deck)
then when draw a card use a trigger to create an item for your card holder type of random item in region(the region which stores all the cards in the deck he is playing with)
REMEMBER: do not reveal those regions! :thup:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top