HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Win after death of two Heros?

12-30-2002, 10:43 PM#1
Kyral
I am working on a Map where the Player have to kill two heros of the Enemy...

what is the corect trigger, that the Player wins after both Heros are dead?

both heros are already on the map
12-31-2002, 05:34 AM#2
Aiursrage2k
Many ways to do this, but if the units are already preplaced, and its only 2 units then this would work.

Event-
Unit (click the hero) dies
Action-
Set hero[x] = hero[x] + 1
if(hero[x] == 2) then
defeat
endif

Where 'hero' is an 'integer array', 'x' is the 'player number of triggering player', duplicate the trigger for the second hero, and copy for the other players.

Prehaps not the most greatest solution but it works.
12-31-2002, 05:50 AM#3
KDEWolf
they don't need 2 be preplaced, just disable this trigger in we, then create the units with da triggers u want n finnaly enable it again. this works fine i did this often in sc maps
12-31-2002, 05:50 AM#4
Electromancer
Well, you could do something for any hero.

Event:
Unit Dies

Condition:
Dieing unit equal to hero
(if a certain players heroes) Owner of dieing unit equal to player x

Action:
(for a group of players) Integer A pick (first human player to last human player*) and do if dieing unit equal to player(integerA) then do set Heroesdied(integervariable)=Heroesdied + 1
(if not a group action) Set Heroesdied=heroesdied + 1

*this trigger should be the first human player in the game, if red then 1 and if blue then 2 and so on and so on, and the last one should be the last person, if gray then 9 or if brown then 12.
12-31-2002, 05:58 AM#5
KDEWolf
yeah it works fine 2! i used da unit die event with da units comanded by player for substituing da player commands x unit from sc.
12-31-2002, 02:18 PM#6
Kyral
I've managed it!
thank you all!