HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Teams?

01-03-2004, 07:45 AM#1
Dimples
Hi,
I'm just curious if anyone could lend a hand, because I can't figure it out.

What I want to make is, a trigger that selects all units in a region, and then randomly assigns a team (and changes color) for each one of them. However, there must only be two teams, and they must have an equal amount of players.

Those of you who played Init's Hero Arena would probably know what I'm talking about. And please let me know if I don't make any sense, I'll try to rephrase.

Thanks in advance. :)
01-03-2004, 12:43 PM#2
AllPainful
Variable - Team = Integer

Code:
Event
Conditions
Actions
  Set Team = 1
  Pick all units in region
    Loop Actiona
      If
        Conditions
           Variable Team = 1
        Then Actions
           Change ownership of picked unit to [color=red]"Team 1"[/color] changing units color
           Set Team = 2
        Else Actions
           Change ownership of picked unit to [color=red]"Team 2"[/color] changing units color
           Set Team = 1

Where "Team 1" and "Team 2" are the actual players you want to give the units too.