No Idea. Spell

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
GetUnitTypeId() == 0 should be the safest for starters.
GetWidgetLife and IsUnitType will fail if you add hp to death units/ add UNIT_TYPE_DEAD to living units.
 

Bribe

vJass errors are legion
Reaction score
67
I've read lots of discussions and this is the first time UnitAlive sometimes failing has ever been brought up. I've done high-speed evaluations with this ability, and the only fails I ever experienced were with GetWidgetLife (and I heard UNIT_TYPE_DEAD fails a lot too). Actually, I've heard a lot about GetWidgetLife and UNIT_TYPE_DEAD failing, and that UnitAlive was the best solution.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
I've read lots of discussions and this is the first time UnitAlive sometimes failing has ever been brought up. I've done high-speed evaluations with this ability, and the only fails I ever experienced were with GetWidgetLife (and I heard UNIT_TYPE_DEAD fails a lot too). Actually, I've heard a lot about GetWidgetLife and UNIT_TYPE_DEAD failing, and that UnitAlive was the best solution.
They are fine to use as long as you play safe.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Situation #1:
01) Unit dies
02) Unit has ressurection (Ankh of reincarnation)
03) Unit is waiting to be revived
04) [lJASS]UnitAlive(Unit) = false[/lJASS]
05) Should be true, imo =/

Situation #2:
01) Unit is removed without being killed ala [lJASS]call RemoveUnit(Unit)[/lJASS]
02) [lJASS]UnitAlive(Unit) = true[/lJASS]
03) Should be false, imo, units not in the game should be dead.

Well, after a wait, it'll return false, so..
Situation 2 isn't really a situation.. xD
 

Bribe

vJass errors are legion
Reaction score
67
GetUnitState is slower than GetWidgetLife, and takes longer to type. It's also a straight copy of the crappy GUI handling of things. But if that's your thing.

05) Should be true, imo =/
Whoa, if that returned true, that would be a great check to see if the unit was reincarnating :p
 

Crazy_Dead

New Member
Reaction score
24
Can someone tell me how to do this Spell? I dont wanna know if GetUnitState or Unit Ailve is fastest or smartest. :D
 

Laiev

Hey Listen!!
Reaction score
188
Can someone tell me how to do this? I dont wanna know if GetUnitState or Unit Ailve is fastest or smartest. :D

do this what? o.o the native?

JASS:
native UnitAlive takes unit id returns boolean

add at any library or in the header of map :p

[ljass]GetUnitState[/ljass] is not recommended, use [ljass]UnitAlive(u)[/ljass] or [ljass]GetWidgetLife(u) > .405[/ljass]
 

Laiev

Hey Listen!!
Reaction score
188
[ljass]UnitAlive[/ljass] <~ Click!

Requiring JassHelper to compile or a manual edit to the war3map.j file, this native is the most sensible and efficient way to detect if a unit is dead; it is a flawless check.
 

tooltiperror

Super Moderator
Reaction score
231
Step one, make two spells, one the activated spell, the other the none activated.

Step two, periodically check if the spell can be activated.

Step three, execute the spell.

Step four, recycle and null and plug the leak holes.
 

Laiev

Hey Listen!!
Reaction score
188
what spell? o.o
i lost this part of the thread

PS: step four is the best <3

EDIT: founded, i need stop to see just the lasts posts :(
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Requiring JassHelper to compile or a manual edit to the war3map.j file, this native is the most sensible and efficient way to detect if a unit is dead; it is a flawless check.

It's not flawless ._.
I posted 2 pitfalls of using it xD
 

Bribe

vJass errors are legion
Reaction score
67
The Reincarnation "pitfall" you will also experience with GetWidgetLife, though from what you say killing a unit inside of a function and checking its life should be done with GetWidgetLife. I didn't know about that last part until you brought it to my attention (I typed what I wrote first), but for conventional purposes UnitAlive owns.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top