• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

I'm totally confused. Hero selection system.

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,141
Hello everyone. I want to create hero selection system but one by one. Here is the hero select order that i want. Player 2/8/3/9/4/10/5/11/6/12

And here is my triggers that i have created but i am totally confused at the moment. What am i missing i don't know

This is how it starts

  • Command TP Copy
    • Events
      • Player - Player 2 (Blue) types a chat message containing -tp as An exact match
    • Conditions
    • Actions
      • Set mod_tp = True
This is the trigger

  • TurnPick
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
      • mod_tp Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to User
          • (Player 2 (Blue) slot status) Equal to Is playing
          • PlayerSelectedHero[2] Equal to False
        • Then - Actions
          • Set NextPlayerSecim = Player 2 (Blue)
          • Player - Set NextPlayerSecim Current lumber to 1
          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
          • Trigger - Run FloatThing <gen> (checking conditions)
          • Wait 10.00 seconds
          • Set PlayerSelectedHero[2] = True
          • Player - Set NextPlayerSecim Current lumber to 0
          • Set NextPlayerSecim = Player 8 (Pink)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 8 (Pink) controller) Equal to User
              • (Player 8 (Pink) slot status) Equal to Is playing
              • PlayerSelectedHero[8] Equal to False
            • Then - Actions
              • Player - Set NextPlayerSecim Current lumber to 1
              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
              • Trigger - Run FloatThing <gen> (checking conditions)
              • Wait 10.00 seconds
              • Set PlayerSelectedHero[8] = True
              • Player - Set NextPlayerSecim Current lumber to 0
              • Set NextPlayerSecim = Player 3 (Teal)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 3 (Teal) controller) Equal to User
                  • (Player 3 (Teal) slot status) Equal to Is playing
                  • PlayerSelectedHero[3] Equal to False
                • Then - Actions
                  • Player - Set NextPlayerSecim Current lumber to 1
                  • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                  • Trigger - Run FloatThing <gen> (checking conditions)
                  • Wait 10.00 seconds
                  • Set PlayerSelectedHero[3] = True
                  • Player - Set NextPlayerSecim Current lumber to 0
                  • Set NextPlayerSecim = Player 9 (Gray)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Player 9 (Gray) controller) Equal to User
                      • (Player 9 (Gray) slot status) Equal to Is playing
                      • PlayerSelectedHero[9] Equal to False
                    • Then - Actions
                      • Player - Set NextPlayerSecim Current lumber to 1
                      • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                      • Trigger - Run FloatThing <gen> (checking conditions)
                      • Wait 10.00 seconds
                      • Set PlayerSelectedHero[9] = True
                      • Player - Set NextPlayerSecim Current lumber to 0
                      • Set NextPlayerSecim = Player 4 (Purple)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player 4 (Purple) controller) Equal to User
                          • (Player 4 (Purple) slot status) Equal to Is playing
                          • PlayerSelectedHero[4] Equal to False
                        • Then - Actions
                          • Player - Set NextPlayerSecim Current lumber to 1
                          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                          • Trigger - Run FloatThing <gen> (checking conditions)
                          • Wait 10.00 seconds
                          • Set PlayerSelectedHero[4] = True
                          • Player - Set NextPlayerSecim Current lumber to 0
                          • Set NextPlayerSecim = Player 10 (Light Blue)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Player 10 (Light Blue) controller) Equal to User
                              • (Player 10 (Light Blue) slot status) Equal to Is playing
                              • PlayerSelectedHero[10] Equal to False
                            • Then - Actions
                              • Player - Set NextPlayerSecim Current lumber to 1
                              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                              • Trigger - Run FloatThing <gen> (checking conditions)
                              • Set PlayerSelectedHero[10] = True
                              • Wait 10.00 seconds
                              • Player - Set NextPlayerSecim Current lumber to 0
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Player 5 (Yellow) controller) Equal to User
                                  • (Player 5 (Yellow) slot status) Equal to Is playing
                                  • PlayerSelectedHero[5] Equal to False
                                • Then - Actions
                                  • Player - Set NextPlayerSecim Current lumber to 1
                                  • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                                  • Trigger - Run FloatThing <gen> (checking conditions)
                                  • Wait 10.00 seconds
                                  • Set PlayerSelectedHero[5] = True
                                  • Player - Set NextPlayerSecim Current lumber to 0
                                  • Set NextPlayerSecim = Player 11 (Dark Green)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Player 11 (Dark Green) controller) Equal to User
                                      • (Player 11 (Dark Green) slot status) Equal to Is playing
                                      • PlayerSelectedHero[11] Equal to False
                                    • Then - Actions
                                      • Player - Set NextPlayerSecim Current lumber to 1
                                      • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                                      • Trigger - Run FloatThing <gen> (checking conditions)
                                      • Wait 10.00 seconds
                                      • Set PlayerSelectedHero[11] = True
                                      • Player - Set NextPlayerSecim Current lumber to 0
                                      • Set NextPlayerSecim = Player 6 (Orange)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Player 6 (Orange) controller) Equal to User
                                          • (Player 6 (Orange) slot status) Equal to Is playing
                                          • PlayerSelectedHero[6] Equal to False
                                        • Then - Actions
                                          • Player - Set NextPlayerSecim Current lumber to 1
                                          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                                          • Trigger - Run FloatThing <gen> (checking conditions)
                                          • Wait 10.00 seconds
                                          • Set PlayerSelectedHero[6] = True
                                          • Player - Set NextPlayerSecim Current lumber to 0
                                          • Set NextPlayerSecim = Player 12 (Brown)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Player 12 (Brown) controller) Equal to User
                                              • (Player 12 (Brown) slot status) Equal to Is playing
                                              • PlayerSelectedHero[12] Equal to False
                                            • Then - Actions
                                              • Player - Set NextPlayerSecim Current lumber to 1
                                              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçmek için 10 saniyen var. + (Name of NextPlayerSecim))
                                              • Trigger - Run FloatThing <gen> (checking conditions)
                                              • Set PlayerSelectedHero[12] = True
                                              • Wait 10.00 seconds
                                              • Player - Set NextPlayerSecim Current lumber to 0
                                            • Else - Actions
      • Game - Display to (All players) the text: go
And this is the floating text that warns players

  • FloatThing
    • Events
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads 10 at (Center of StartCamera <gen>) with Z offset 0.00, using font size 20.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set SecimFloat = (Last created floating text)
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 9 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 8 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 7 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 6 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 5 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 4 using font size 20.00
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 3 using font size 20.00
      • Floating Text - Change the color of SecimFloat to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 2 using font size 20.00
      • Floating Text - Change the color of SecimFloat to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 1.00 seconds
      • Floating Text - Change text of SecimFloat to 1 using font size 20.00
      • Floating Text - Change the color of SecimFloat to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 1.00 seconds
      • Floating Text - Destroy SecimFloat
And this trigger detects if the player selects the hero.

  • SiraSecim
    • Events
      • Player - Player 2 (Blue)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 3 (Teal)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 4 (Purple)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 5 (Yellow)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 6 (Orange)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 8 (Pink)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 9 (Gray)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 10 (Light Blue)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 11 (Dark Green)'s Food used becomes Greater than or equal to 1.00
      • Player - Player 12 (Brown)'s Food used becomes Greater than or equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NextPlayerSecim Equal to Player 2 (Blue)
        • Then - Actions
          • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
          • Player - Set NextPlayerSecim Current lumber to 0
          • Set NextPlayerSecim = Player 8 (Pink)
          • Floating Text - Destroy SecimFloat
          • Game - Display to (All players) the text: float gitmeli
          • Trigger - Run TurnPick <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NextPlayerSecim Equal to Player 8 (Pink)
            • Then - Actions
              • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
              • Player - Set (Triggering player) Current lumber to 0
              • Set NextPlayerSecim = Player 3 (Teal)
              • Floating Text - Destroy SecimFloat
              • Game - Display to (All players) the text: float gitmeli
              • Trigger - Run TurnPick <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NextPlayerSecim Equal to Player 3 (Teal)
                • Then - Actions
                  • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                  • Player - Set (Triggering player) Current lumber to 0
                  • Set NextPlayerSecim = Player 9 (Gray)
                  • Floating Text - Destroy SecimFloat
                  • Game - Display to (All players) the text: float gitmeli
                  • Trigger - Run TurnPick <gen> (checking conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • NextPlayerSecim Equal to Player 9 (Gray)
                    • Then - Actions
                      • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                      • Player - Set (Triggering player) Current lumber to 0
                      • Set NextPlayerSecim = Player 4 (Purple)
                      • Floating Text - Destroy SecimFloat
                      • Game - Display to (All players) the text: float gitmeli
                      • Trigger - Run TurnPick <gen> (checking conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • NextPlayerSecim Equal to Player 4 (Purple)
                        • Then - Actions
                          • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                          • Player - Set (Triggering player) Current lumber to 0
                          • Set NextPlayerSecim = Player 10 (Light Blue)
                          • Floating Text - Destroy SecimFloat
                          • Trigger - Run TurnPick <gen> (checking conditions)
                          • Game - Display to (All players) the text: float gitmeli
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • NextPlayerSecim Equal to Player 10 (Light Blue)
                            • Then - Actions
                              • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                              • Player - Set (Triggering player) Current lumber to 0
                              • Set NextPlayerSecim = Player 5 (Yellow)
                              • Floating Text - Destroy SecimFloat
                              • Trigger - Run TurnPick <gen> (checking conditions)
                              • Game - Display to (All players) the text: float gitmeli
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • NextPlayerSecim Equal to Player 5 (Yellow)
                                • Then - Actions
                                  • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                                  • Player - Set (Triggering player) Current lumber to 0
                                  • Set NextPlayerSecim = Player 11 (Dark Green)
                                  • Floating Text - Destroy SecimFloat
                                  • Trigger - Run TurnPick <gen> (checking conditions)
                                  • Game - Display to (All players) the text: float gitmeli
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • NextPlayerSecim Equal to Player 11 (Dark Green)
                                    • Then - Actions
                                      • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                                      • Player - Set (Triggering player) Current lumber to 0
                                      • Set NextPlayerSecim = Player 6 (Orange)
                                      • Floating Text - Destroy SecimFloat
                                      • Trigger - Run TurnPick <gen> (checking conditions)
                                      • Game - Display to (All players) the text: float gitmeli
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • NextPlayerSecim Equal to Player 6 (Orange)
                                        • Then - Actions
                                          • Set PlayerSelectedHero[(Player number of (Triggering player))] = True
                                          • Player - Set (Triggering player) Current lumber to 0
                                          • Set NextPlayerSecim = Player 12 (Brown)
                                          • Floating Text - Destroy SecimFloat
                                          • Trigger - Run TurnPick <gen> (checking conditions)
                                          • Game - Display to (All players) the text: float gitmeli
                                        • Else - Actions
I would like to tell you what is not working but currently nothing works properly. Is someone can help me to fix this system? Currently it can detect player 8 after player 2 but i am testing it with player 2 and 3, after player 2 it is not passing player 3 and float is not working properly. Current i give up because i am tired.

Update: For the make it clear, let me what i want.

I want make 10 players select heroes one by one but order is 2 8 3 9 4 10 5 11 6 and player 12

All players have a 10 seconds for the select their heroes. If they will pick or pass the time, it comes to next player.
 
Last edited:
Level 7
Joined
Feb 6, 2018
Messages
72
So you're using If-Else statements in your TurnPick trigger. This means that if the conditions are true, it will execute the actions in the "Then" part, and if they are false it will execute the actions in the "Else" section, right? So what happens if player 2 is playing? It will not go to the "Else" part and thus not proceed to the next player.
There is also a ton of unnecessary repetition that can be solved by using loops instead. You might find this turorial useful.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
So you're using If-Else statements in your TurnPick trigger. This means that if the conditions are true, it will execute the actions in the "Then" part, and if they are false it will execute the actions in the "Else" section, right? So what happens if player 2 is playing? It will not go to the "Else" part and thus not proceed to the next player.
There is also a ton of unnecessary repetition that can be solved by using loops instead. You might find this turorial useful.
Hello my friend. I have made a changes on it, let me show you the new version.

  • TurnPick
    • Events
      • Time - Elapsed game time is 12.00 seconds
    • Conditions
      • mod_tp Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current lumber to 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to User
          • PlayerSecti[2] Equal to False
        • Then - Actions
          • Set NextPlayerSecim = Player 2 (Blue)
          • Player - Set NextPlayerSecim Current lumber to 1
          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 8 (Pink) controller) Equal to User
              • PlayerSecti[8] Equal to False
            • Then - Actions
              • Set NextPlayerSecim = Player 8 (Pink)
              • Player - Set NextPlayerSecim Current lumber to 1
              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 3 (Teal) controller) Equal to User
                  • PlayerSecti[3] Equal to False
                • Then - Actions
                  • Set NextPlayerSecim = Player 3 (Teal)
                  • Player - Set NextPlayerSecim Current lumber to 1
                  • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Player 9 (Gray) controller) Equal to User
                      • PlayerSecti[9] Equal to False
                    • Then - Actions
                      • Set NextPlayerSecim = Player 9 (Gray)
                      • Player - Set NextPlayerSecim Current lumber to 1
                      • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player 4 (Purple) controller) Equal to User
                          • PlayerSecti[4] Equal to False
                        • Then - Actions
                          • Set NextPlayerSecim = Player 4 (Purple)
                          • Player - Set NextPlayerSecim Current lumber to 1
                          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Player 10 (Light Blue) controller) Equal to User
                              • PlayerSecti[10] Equal to False
                            • Then - Actions
                              • Set NextPlayerSecim = Player 10 (Light Blue)
                              • Player - Set NextPlayerSecim Current lumber to 1
                              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Player 5 (Yellow) controller) Equal to User
                                  • PlayerSecti[5] Equal to False
                                • Then - Actions
                                  • Set NextPlayerSecim = Player 5 (Yellow)
                                  • Player - Set NextPlayerSecim Current lumber to 1
                                  • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Player 11 (Dark Green) controller) Equal to User
                                      • PlayerSecti[11] Equal to False
                                    • Then - Actions
                                      • Set NextPlayerSecim = Player 11 (Dark Green)
                                      • Player - Set NextPlayerSecim Current lumber to 1
                                      • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Player 6 (Orange) controller) Equal to User
                                          • PlayerSecti[6] Equal to False
                                        • Then - Actions
                                          • Set NextPlayerSecim = Player 6 (Orange)
                                          • Player - Set NextPlayerSecim Current lumber to 1
                                          • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Player 12 (Brown) controller) Equal to User
                                              • PlayerSecti[12] Equal to False
                                            • Then - Actions
                                              • Set NextPlayerSecim = Player 12 (Brown)
                                              • Player - Set NextPlayerSecim Current lumber to 1
                                              • Game - Display to (All players) for 10.00 seconds the text: (Hero seçme sirasi sende + (Name of NextPlayerSecim))
                                            • Else - Actions
We can talk about Floats later. Still i couldn't arrived to my home for the test it. Can we make some kind of arrangements to this trigger?
 
Status
Not open for further replies.
Top