HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Can I check if a unit is vulnerable or not?

06-26-2005, 05:25 PM#1
karukef
Title says it all. Can I check if a unit is vulnerable or not, regardless on how this invulnerability was obtained (per ability, divine shield, trigger etc). I was surprised when I couldn't find this in the triggers but did I miss something?

I can of course check if it has the Invulnerable buff, but does all invulnerable units get this buff? (After testing I can't say I know anything that causes the unit to gain the invulnerable buff, cause no units regardless of how they obtained invulnerability had it)
06-26-2005, 05:28 PM#2
Elven Ronin
I believe there's a boolean comparison for that. Its unit status or something like that. The one that comes up by default when you make a boolean condition.
06-26-2005, 05:37 PM#3
karukef
Quote:
Originally Posted by Elven Ronin
I believe there's a boolean comparison for that. Its unit status or something like that. The one that comes up by default when you make a boolean condition.

That answer is completely worthless. You "believe" there is a boolean comparison? I already said I couldn't find it in the triggers, so unless you can tell me exactly which trigger instead of believing things, you aren't really doing anything useful.
06-26-2005, 05:52 PM#4
Elven Ronin
Hmmm... I just looked through WE... What I was thinking of was a unit classification check, which I thought had invulnerable among the classifications, but I guess it doesn't. It has everything else, but not that for some reason. There aren't any other boolean functions pertaining to that...
06-26-2005, 05:57 PM#5
Anitarf
You can always try casting a spell that can target anything except invulnerable onto the unit with a dummy caster... if the caster casts the spell in a given ammount of time, then the unit is vulnerable, otherwise it is not... Or you can check for all known invulnerablity buffs, what, there are, like, two of them? As far as trigger-invulnerated units go, you can just keep track of them, if you give them invulnerability using triggers, you can use the same triggers to store information about that somewhere...
06-26-2005, 08:07 PM#6
karukef
Quote:
Originally Posted by Anitarf
You can always try casting a spell that can target anything except invulnerable onto the unit with a dummy caster... if the caster casts the spell in a given ammount of time, then the unit is vulnerable, otherwise it is not... Or you can check for all known invulnerablity buffs, what, there are, like, two of them? As far as trigger-invulnerated units go, you can just keep track of them, if you give them invulnerability using triggers, you can use the same triggers to store information about that somewhere...

Yeah, well, that would be a rather horrible solution.

And btw, there is only one invulnerable buff, and as I stated I cant detect that on anything that is invulnerable so I'm not sure if its used or not.
06-27-2005, 12:38 PM#7
Koga73
Quote:
Originally Posted by karukef
Yeah, well, that would be a rather horrible solution.

And btw, there is only one invulnerable buff, and as I stated I cant detect that on anything that is invulnerable so I'm not sure if its used or not.

well, theres always a way, in this case, its just not ez, use custom values of units and keep track of whether its vulnerable or not, or use a boolean array.
06-27-2005, 12:45 PM#8
iNfraNe
create a dummy unit, with attack damage 0-0 (dice = 1, rolls = 1, base damage = -1) and make it attack the unit, then after that (without any waits) check its order, if it is attack then it isnt vulnerable, else it is.
03-04-2006, 01:41 PM#9
Vexorian
Easiest way is to let something do 0.01 damage using a damage native, and if the hp is reduced (no need for waits) then the unit is not invulnerable.
03-04-2006, 04:04 PM#10
karukef
Sounds like a useful way to do it, thanks.