• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Trigger: Checking if all Heroes are Revived

Status
Not open for further replies.
Level 7
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).
  • [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
 
Level 7
Joined
Sep 4, 2016
Messages
116
I realized this should probably be in the Triggers and Script section, which I was less familiar with.
I meant to delete this after re-posting it there, since I couldn't find a way to move it, but turns out I don't know how to delete this either.
I made a mistake, but please do go check it out there if you can help.

 
Status
Not open for further replies.
Top