HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Reviving neutral hostile heroes

01-04-2011, 02:43 PM#1
Malfurion
Hello folks,
I have a problem with the trigger editor. On my map you have to defeat several bosses. All bosses are neutral hostile heroes. When you encounter the final boss and he loses a certain amount of health, he is supposed to revive one random previous boss.
So I saved all the bosses in a unit-array (with a length of 20).

Trigger:
Boss 1
Collapse Events
Unit - A unit owned by Neutral hostile dies
Collapse Conditions
((Triggering unit) is A hero) Equal to True
Collapse Actions
Set Heroarray[Heroindex] = (Dying unit)
Set Heroindex = (Heroindex + 1)

And this happens when I encounter the boss:
Trigger:
ResurrectBoss
Collapse Events
Unit - Final Boss 0002 <gen> takes damage
Collapse Conditions
(Life of Final Boss 0002 <gen>) smaller then 70000.00
Collapse Actions
Hero - Instantly revive Heroarray[(Random integer number between 0 and 9)] at (Center of Area 001 <gen>), Hide revival graphics
Trigger - Turn off (This trigger)

But nothing happens when the boss is below 70000 HP. I also tried "Unit - Final Boss 0002 <gen> is attacked", but it didn't work either.
Could you help me with that problem?
01-04-2011, 04:01 PM#2
tamisrah
Add some debug messages into the second trigger to verify these:
* does the trigger fire?
* is the condition met? (therefore move the condition into an if-statement)
* is the array filled (check the var heroindex, and check the respective spot in the array to be not null)

And DO NOT REMOVE the dead bosses or you won't be able to ressurect them anyway.
01-04-2011, 05:20 PM#3
Malfurion
Thanks for your help!
Debugging worked quite well. Apparently the revival was ignored and the trigger jumped right to the turnoff-action. Working with If, then else fixed the problem.