• 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.

Event - unit is revived?

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
I'm making a custom health bar system. The bar has to be hidden when a unit dies, and shown again if it's revived. The thing is, units can be revived in many ways: altars, triggers and resurrection. Is there a way to detect all these events?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Depends on what event it is,
For resurrection , the event to detect it is 'Unit - A Unit starts the effect of an ability'
and the condition would be 'Resurrection' , can be used for Ankhs and Reincarnation (Orc ability)

For altars, it might be a unit is being trained ..? and the condition might be (Unit being trained equal to 'Your hero') ( Or unit type equal to 'your hero's unit-type' )

For triggers, it can be done in many ways, using booleans for example, for example, the trigger of reviving ( Hero - Revive Hero at point ) , afterwards make boolean ( HeroRevived = True )... And make another trigger using the event (' Time - Every 0.1 seconds of the game ) , the condition would be ( HeroRevived = True ) , Actions would be ( Trigger - Turn off this trigger , and run your health bar trigger ) ,
You can keep it on tho

Good luck
 
Level 10
Joined
Jun 6, 2007
Messages
392
Thanks, I think I'll take a different approach then. Instead of removing and recreating the bar, I'll change it's visibility in a periodic trigger based on unit's health. Bar will be destroyed when a unit is removed permanently.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
IIRC, resurrection revived units can be detected via "A Unit Spawns" event, I haven't tested it myself though. Heroes have dedicated event's I think.
 
Status
Not open for further replies.
Top