• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Summoning is only to Red and Yellow

Status
Not open for further replies.
Level 3
Joined
Dec 22, 2008
Messages
25
Summoning not working properly

I have two teams.
Team 1: Red, Blue, Teal, Purple
Team 2: Yellow, Orange, Green, Pink

Now I am trying to figure out why it isn't working.
  • Events
    • Unit - A unit Sells a unit
  • Player Group - Remove all players from Summonable_Players[0]
  • Player Group - Add Player 1 (Red) to Summonable_Players[0]
  • Player Group - Add Player 2 (Blue) to Summonable_Players[0]
  • Player Group - Add Player 3 (Teal) to Summonable_Players[0]
  • Player Group - Add Player 4 (Purple) to Summonable_Players[0]
  • If (((Max(Summon_count[0], Summon_count[1])) Equal to Summon_count[0]) and (((Max(Summon_count[0], Summon_count[2])) Equal to Summon_count[0]) and ((Max(Summon_count[0], Summon_count[3])) Equal to Summon_count[0]))) then do (Player Group - Remove Player 1 (Red) from Summonable_Players[0]) else do (Do nothing)
  • If (((Max(Summon_count[1], Summon_count[0])) Equal to Summon_count[1]) and (((Max(Summon_count[1], Summon_count[2])) Equal to Summon_count[1]) and ((Max(Summon_count[1], Summon_count[3])) Equal to Summon_count[1]))) then do (Player Group - Remove Player 2 (Blue) from Summonable_Players[0]) else do (Do nothing)
  • If (((Max(Summon_count[2], Summon_count[0])) Equal to Summon_count[2]) and (((Max(Summon_count[2], Summon_count[1])) Equal to Summon_count[2]) and ((Max(Summon_count[2], Summon_count[3])) Equal to Summon_count[2]))) then do (Player Group - Remove Player 3 (Teal) from Summonable_Players[0]) else do (Do nothing)
  • If (((Max(Summon_count[3], Summon_count[0])) Equal to Summon_count[3]) and (((Max(Summon_count[3], Summon_count[2])) Equal to Summon_count[3]) and ((Max(Summon_count[3], Summon_count[1])) Equal to Summon_count[3]))) then do (Player Group - Remove Player 4 (Purple) from Summonable_Players[0]) else do (Do nothing)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of players in Summonable_Players[0]) Equal to 0
    • Then - Actions
      • -------- IF ALL ARE EQUAL, SEND TO RED --------
      • Unit - Move (Sold unit) instantly to (Center of RedSpawn <gen>)
      • Set Summon_count[0] = (Summon_count[0] + 1)
    • Else - Actions
      • For each (Integer A) from 0 to ((Number of players in Summonable_Players[0]) - 1), do (Actions)
        • Loop - Actions
          • Player Group - Remove (Random player from Summonable_Players[0]) from Summonable_Players[0]
      • -------- THERE IS ONLY 1 PLAYER IN PLAYERGROUP --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random player from Summonable_Players[0]) Equal to Player 1 (Red)
        • Then - Actions
          • Unit - Move (Sold unit) instantly to (Center of RedSpawn <gen>)
          • Set Summon_count[0] = (Summon_count[0] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random player from Summonable_Players[0]) Equal to Player 2 (Blue)
            • Then - Actions
              • Unit - Move (Sold unit) instantly to (Center of BlueSpawn <gen>)
              • Set Summon_count[1] = (Summon_count[1] + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random player from Summonable_Players[0]) Equal to Player 3 (Teal)
                • Then - Actions
                  • Unit - Move (Sold unit) instantly to (Center of TealSpawn <gen>)
                  • Set Summon_count[2] = (Summon_count[2] + 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random player from Summonable_Players[0]) Equal to Player 4 (Purple)
                    • Then - Actions
                      • Unit - Move (Sold unit) instantly to (Center of PurpleSpawn <gen>)
                      • Set Summon_count[3] = (Summon_count[3] + 1)
                    • Else - Actions
                      • Unit - Move (Sold unit) instantly to (Center of RedSpawn <gen>)
                      • Set Summon_count[0] = (Summon_count[0] + 1)
For some reason it only sends to red :(

Summons_Count represents the amount of units sent to each player, so at the start of the game this would be 0 for everyone.
Summons_Count[0] represents red.


So this is what happens when Team 2 summons.
Add all players of Team 1 ( which can be summoned to ) to the Player Group.
If Red has received more summons than the other players, remove red from players that this unit can be summoned to.
If there are more players in the player group of which this unit can be summoned to remove as many players from the group until 1 remains.
If the remaining player = Blue, send unit to play and increase Summons_Count by 1.
 
Last edited:
Status
Not open for further replies.
Top