PDA

View Full Version : How to detect if the ''Damage Source'' is not a unit?


Ramza
12-24-2010, 08:51 PM
One of my custom abilities is using an action which damages the damage source. But it should only damage the damage source if it's an attack by a unit, and not, for example, poison damage or damage caused by some other buff.

Is there a way to this?

Edit: Only 1 unit can cast this ability (on itself). Any unit that damages the caster while under the effect of its ability, is affected by the damage source action.

Edit:
http://www.mani.de/ivolume/gfx/SolvedStamp.png

Vunjo
12-25-2010, 12:34 AM
If I get it right, you can add condition that will check if caster is teh target?

Ramza
12-25-2010, 12:39 AM
Yeah, that's no problem. What I don't get is how to detect if the damage source is an ability, a buff, or a unit.

Vunjo
12-25-2010, 12:46 AM
Condition, attacking unit is "no unit"? Try it, sorry I don't have much time to test. Maybe it will work ^^

Dr Super Good
12-25-2010, 03:51 AM
Impossible out right. You have to eithor make a custom damage system so you know where the damage comes from or use some sort of logical system to limit the possibilites of where damage comes from (not always 100% accurate).

Maker
12-25-2010, 08:41 AM
If you set the damage source into a variable and then check Damage source not equal to no unit, it will return true if the damage source is a unit. I've used that before.

So first try what Vunjo said. If it doesn't works, try not equal to no unit.

Vunjo
12-25-2010, 09:48 AM
ergh, if my logic is correct, "not equal to no unit" means that it is a unit?

EDIT: Merry Xmass guys =)

Maker
12-25-2010, 04:05 PM
ergh, if my logic is correct, "not equal to no unit" means that it is a unit?

check Damage source not equal to no unit, it will return true if the damage source is a unit.

Yes, just like I said. Is there any confusion? You can use if/then/else.

Merry christmas to you too.

Ramza
12-27-2010, 12:24 AM
Thanks everyone. Solved. :)