- Joined
- Sep 4, 2016
- Messages
- 116
Hello my fellows!
I am running into an interesting challenge with one of my triggers for my current map project, having to do with the revival process for Heroes the player uses. A player can have up to two heroes, and when all heroes are alive, I need to remove units used only during the revival process.
It's been working pretty well, until one hero produced a problem.
I have a hero using a hero ability with Stone Form as the base ability, so there are unit equivalents involved. I have found that when this hero dies in its alternate form, if it is not revived first, my trigger detects no remaining dead heroes, and subsequently prevents his revival.
I have another hero with a normal Stone Form ability, where this issue does not occur.
I'm not really sure how best to fix this or what might be the exact reason the alternate form , so I have my trigger here (most of it). Any ideas how to fix this? All guidance will be appreciated!
I'm not used to posting triggers, so it may not look great. I also understand, looking back, this would have some leaks with the unit groups I think (I will probably fix that soon).
I am running into an interesting challenge with one of my triggers for my current map project, having to do with the revival process for Heroes the player uses. A player can have up to two heroes, and when all heroes are alive, I need to remove units used only during the revival process.
It's been working pretty well, until one hero produced a problem.
I have a hero using a hero ability with Stone Form as the base ability, so there are unit equivalents involved. I have found that when this hero dies in its alternate form, if it is not revived first, my trigger detects no remaining dead heroes, and subsequently prevents his revival.
I have another hero with a normal Stone Form ability, where this issue does not occur.
I'm not really sure how best to fix this or what might be the exact reason the alternate form , so I have my trigger here (most of it). Any ideas how to fix this? All guidance will be appreciated!
I'm not used to posting triggers, so it may not look great. I also understand, looking back, this would have some leaks with the unit groups I think (I will probably fix that soon).
-
[EVENTS]
-
Unit - A unit Finishes reviving
-
-
[CONDITIONS]
-
((Units owned by (Triggering player) matching ((Unit-type of (Matching unit)) Equal to Special Revival Unit)) is empty) Equal to True
-
-
[ACTIONS]
-
Unit Group - Add all units of (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) to HeroesAliveCalculation
-
Set IntC = (Number of units in HeroesAliveCalculation)
-
Unit Group - Pick every unit in HeroesAliveCalculation and do (Actions)
-
[Loop - Action]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
[If - Conditions]
-
((Picked unit) is alive) Equal to False
-
-
[Then - Actions]
-
Unit Group - Remove (Picked unit) from HeroesAliveCalculation
-
-
-
-
[If (All COnditions are True) then do (Then Actions) else do (Else Actions)
-
[If - Conditions]
-
(Number of units in HeroesAliveCalculation) Equal to IntC
-
-
[Then - Actions]
-
... Remove some specified unnecessary unit group
-
-
-