HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting damage done

01-11-2004, 06:16 AM#1
Narwanza
How the heck do you dectect how much damage is done to a unit? This is an indirect way of me telling how much attack a unit has, is there an easier way to tell how much attack a unit has?
01-11-2004, 06:51 AM#2
FyreDaug
It's either a real or an integer. Event response - Damage Taken
01-11-2004, 06:10 PM#3
Pesmerga
But that only works for 'Specific Unit - A unit takes damage' event. And that is extremely hard to work on unless its a 1v1 battle.... Is it possible to set a variable to the unit being attacked, so I can use it in Specific Unit event?
01-11-2004, 06:54 PM#4
Narwanza
in jass there is function called EVENT_UNIT_DAMAGED. I might just use that and see if it will work. But is there a condition that would allow me to make sure it is the right unit doing the damaging?
01-11-2004, 08:14 PM#5
Pesmerga
tell me if it does. Im trying to detect the damage inflicted on a unit but without using a 'specific unit event'.
01-11-2004, 08:19 PM#6
Hunter0000
im not sure if this would work but try this

Triger 1

EVENT
unit is attacked
ACTION
set tempunit = attacked unit

Trigger 2
EVENT
tempunit takes damage
CONDITIONS
blah(whatever you need)
ACTION
blah(whatever you need)

not sure if that would work tho
01-11-2004, 08:20 PM#7
Narwanza
I tried everything I could think of in that dang JASS code and nothing worked. It has to be used with the specific unit event, but my question is why? Why is there a specific unit event in the fist place? We should be able to access any unit function using variables. Even if they aren't variables we have assigned, i.e., Attacking Unit, etc...

Hunter that wouldn't work. Takes damage is a function that can only be used in specific unit event, no variables excepted there.
01-11-2004, 08:27 PM#8
Hunter0000
ahhh, ok try this then, its a work-a-round

Triger 1

EVENT
unit is attacked
CONDITIONS
blah(whatever you need)
ACTION
create event for trigger 2 "attacked unit takes damage"


Trigger 2
EVENT
(created events)
CONDITIONS
these should be in both triggers to avoid event flooding this trigger thus killing it.
ACTION
blah(whatever you need)
01-12-2004, 12:33 AM#9
Pesmerga
and how do you go upon making an event for a different trigger?

EDIT - wouldnt work anyways! you still dont seem to understand, its a specific unit event! you cant use a variable when selecting a specific unit!