HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Win conditions with units

08-15-2004, 04:58 PM#1
GenoBreakerX
all right i am making a map where two teams of zerglings fight eachother and i would like to know how do i setup a trigger where if one team of zerglings kills the other team the first team wins and vice versa.
08-15-2004, 05:02 PM#2
ChipmunkMofia
its easier to put a speacial unit for each team and if they die, that team loses.

Event- specific unit dies

Owner of unit- Defeat
Victory for owner of killing unit

There's other ways, but this is an easier way. Hope it helps :D
08-15-2004, 05:31 PM#3
Anitarf
Code:
Events:
  generic unit event - a unit dies
Conditions:
Actions:
  set tempUnitGroup = Units in region matching condition - Units in (playable map area) matching (and - (boolean comparison - ((matcing unit) is alive) equal to true) and (boolean comparison - (owner of (matching unit)) is an ally of (player 1)) equal to true)
  If - then - else multiple functions
    If - conditions:
      integer comparison - number of units in (tempUnitGroup) equal to 0
    then - actions:
      end game in defeat for player 1
      end game in defeat for player 2
      end game in defeat for player 3
      ..... (do this for every other player on team 1, and do the victory action for everybody on team 2)
    else - actions:
      do nothing
  custom script:  call DestroyGroup( udg_tempUnitGroup )

  (repeat the above actions to check for the other team)
08-16-2004, 12:16 AM#4
GenoBreakerX
anitarf where are all those located
08-16-2004, 07:33 AM#5
Anitarf
In the trigger editor, dooh.

Seriously, look around a bit. The unit actions are normaly under unit and unit-group categories. Set variable and If-then-else are under general. So is, when doing conditions, "And".

You should look around the trigger editor anyway, to learn a bit what you can do with it.
08-16-2004, 11:43 AM#6
SpadeZ
All the actions that Anitarf stated are within the "generall" section of the actions except for end game action, which is located in the "game" section.
08-16-2004, 07:43 PM#7
GenoBreakerX
"set tempUnitGroup = Units in region matching condition - Units in (playable map area) matching (and - (boolean comparison - ((matcing unit) is alive) equal to true) and (boolean comparison - (owner of (matching unit)) is an ally of (player 1)) equal to true)"

Nevermind