Ally Groups

Level 1
Joined
Jun 21, 2009
Messages
282
I need a trigger where it'll check all 12 player's heros for a passive ability every 5 seconds or something, there are 5 passive abilities, for each passive ability I need it to be on a separate team, each team will be allied with their own players with the same passive ability and will be able to trade only money with them (allied, no vision shared) but each team will be hostile to the other teams so its like a free for all.

Could anyone make a trigger of a such?
 
Level 27
Joined
Jan 26, 2007
Messages
4,788
This would be about exactly what you asked (I hope):

  • Ally Players
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • -------- Clear forces --------
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Player Group - Remove all players from alliedForce[(Integer A)]
      • -------- Unally all Players --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Make (Player((Integer A))) treat (Player((Integer B))) as an Enemy
      • -------- Checking for abilities --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of PAS ABIL 1 for Hero[(Integer A)]) Greater than 0
            • Then - Actions
              • Player Group - Add (Player((Integer A))) to alliedForce[1]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of PAS ABIL 2 for Hero[(Integer A)]) Greater than 0
                • Then - Actions
                  • Player Group - Add (Player((Integer A))) to alliedForce[2]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of PAS ABIL 3 for Hero[(Integer A)]) Greater than 0
                    • Then - Actions
                      • Player Group - Add (Player((Integer A))) to alliedForce[3]
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of PAS ABIL 4 for Hero[(Integer A)]) Greater than 0
                        • Then - Actions
                          • Player Group - Add (Player((Integer A))) to alliedForce[4]
                        • Else - Actions
                          • Player Group - Add (Player((Integer A))) to alliedForce[5]
      • -------- Ally the correct players --------
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in alliedForce[(Integer A)] and do (Actions)
            • Loop - Actions
              • Set tempPlayer = (Picked player)
              • Player Group - Pick every player in alliedForce[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Player - Make tempPlayer treat (Picked player) as an Ally
Variables:
unit variable, array "Hero" (you have to store the hero of each player in here, player 3 (Teal)'s hero will be stored in Hero[3], Player 6's hero in Hero[6] etc).
player group, array "alliedForce".

First step: clearing all player groups. This is necessary because we need to set them up anew.
Second step: Making all players enemies of each other.
Third step: checking the abilities of all heroes (you must have an arrayed variable which stores the hero of each player!)
Fourth step: allying the correct players again

Perhaps you could find a better event though? This is somewhat heavy...
 
Level 1
Joined
Jun 21, 2009
Messages
282
If you could put this on a map and make side notes of what I need to input, that would be less heavy. xD

Oh and the passive abilities will always be level 1.. just so you know
 
Level 1
Joined
Jun 21, 2009
Messages
282
I've attached the map to this post.
I hope you already have a hero selection system, you just nee to set "Hero" correctly then (as can be seen in the Demo-trigger).

This trigger does not work completely, red is allied with his teamates with the same passive ability, but those teamates are like hostile to everyone including red, and so other players were attacking me even though they were supposed to be my allies.

Please, someone fix this, its a big issue.
 
Top