| 09-09-2004, 11:21 PM | #1 |
I tried searching the forum for an answer, and I failed to find anything. Therefore, here I am asking what just might be a stupid question. Is there a way to call for the damage inflicted on a unit? |
| 09-09-2004, 11:45 PM | #2 |
Guest | Use like this: EVENT: - Specific Unit Event -> (Unit) takes damage CONDITIONS: - (whatever) ACTIONS: - Set (real variable) = (Trigger Response->Damage taken) Hope that helps. Salutions® |
| 09-10-2004, 02:22 PM | #3 | |
Quote:
Are you sure that "Trigger Response-Damage Taken" exists? I guess I'm just blind. I'm in school at the moment, so I guess I'll take another look to see if it's there. If it is, then I apologize for wasting your time. However, I don't think that the event, "Unit takes damage", exists, so I wonder if that Trigger response exists. I know that a "Unit is attacked" event exists, but I don't know about that Response... :( If someone other than Mara could give their opinion on the matter, I'd really appreciate it. |
| 09-11-2004, 03:00 AM | #4 |
Ok, I apologize in advanced for "double posting", but I didn't want this next post to go unnoticed. Yes, I'm an idiot. Those functions were there, but now I have another problem. That problem being that I have to use the "Specific Unit Event" rather than a Generic one. It would've been fine, if it had let me use a variable to define the unit, but of course, it doesn't. Thank you, Blizzard. I tried to turn the function into JASS and manually put in the name of the variable, but that didn't work either. You see, the unit that the event will apply to is going to be created in the game, not before. Is there any way to set the Specific Unit to a unit that will be created in the game? :( |
| 09-11-2004, 04:12 AM | #5 |
Set that unit into a variable when it is created, then create another 2 Real variables, then do a trigger like this: EVENT: - Timed Event -> every 0.50 seconds on the game( or less) ACTIONS: - Set (real variable) = Curren hit points of your unit (unit - Property) Then make other trigger: EVENT: - Specific Unit Event -> (Unit) is attacked ACTIONS: - Set (real variable) = Unit life (variable) - Hit points of (your unit). This may cause some lag, but it does what you want. |
| 09-11-2004, 03:21 PM | #6 | |
Guest | Quote:
Yes, that arithmetic operation should work, but can be very problematic when the unit is attacked by several enemies at same time; anyway, I know nothing better for units created in-game. Salutions® |
| 09-11-2004, 05:03 PM | #7 |
Damage taken does exist |
| 09-12-2004, 10:45 AM | #8 |
Im a little rusty, but if i remember correctly the way that was developed to do this was to create a new event for each unit you want to be checked. I can't remember the trigger exactly, the function might be by jass only. Just make sure to delete the event after the unit dies of you will find yourself in a world of lag. This might not be what you want to do becuase it sounds like you want to do it for all the units on the map. |
| 09-12-2004, 12:05 PM | #9 |
best luck is to dl WEU and use adv. triggers ![]() |
| 09-12-2004, 06:34 PM | #10 | |
Guest | Quote:
Oh yes, obsidian's right. Just save the unit like a variable, and then use the action "Trigger - Add Event". There you can add the "Specific Unit - Takes Damage" event with that unit-type variable, or Last created unit or whatever you want. Salutions® |
| 09-12-2004, 10:18 PM | #11 | |
Quote:
|
