HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do you select a variable enemy for a "When units life is #"

06-27-2006, 03:23 AM#1
Sardius
When unit's life is less then or equal too #

How do you make an event that selects a variable unit, I can only seemed to do it for a pre placed unit.
06-27-2006, 03:37 AM#2
nevir
I'm not sure exactly what you're trying to do, but I think this might do it:

Trigger:
Detect Life
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Percentage life of (Attacked unit)) Less than or equal to ##.##
Actions

Is that what you're looking for?

Note you could test for their actual life value rather than a percent, if you want to go that route.
06-27-2006, 03:40 AM#3
darkwulfv
I think all you have to do make a unit-group and set it to the units of your type and then do the rest of your actions. But that may not work if it's for only one specific unit and there's more than one of them. Other than that I personally don't know. Alot of other people do though.
06-27-2006, 03:49 AM#4
Sardius
I'll give that a try, should work
06-27-2006, 03:49 AM#5
PipeDream
Built in there is only a unit version.
Collapse JASS:
call TriggerRegisterUnitStateEvent(t,the_unit_handle,UNIT_STATE_LIFE,LESS_THAN_OR_EQUAL,threshold_real)
Chances are there's a better way to implement whatever it is you're trying to do. Elaborate..