• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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