| 01-05-2006, 05:11 AM | #1 |
Ok, i've done some search through the forums and wasn't really able to find an effective and accurate way to calculate armor and damage of a hero and a way to change the unit's armor. Currently i'm working with knowing the base armor of the hero and adding his agility divided by the number of points needed for one armor point. That, as you can see, is very poor. It doesn't consider bonus armor added directly to it (it considers agi bonus). To make this effective I would have to check for every single buff that alters armor one by one and add/subtract to my calculation. That's gonna take some time and it's a pain to maintain. The same situation above can be applied to calculating the damage of an unit. The World Editor Unlimited has some triggers like Get Damage/Defense Bonus and even an action to change a unit's Defense. But I couldn't make it work. Advanced Triggers and Advanced Spell were added and activated but it doesn't seem to work. Example Situation: a trigger tells me some unit defense bonus. It displays 0. I cast inner fire on that unit. It still displays 0. Well, thanks in advance if you took your time to read this big post. |
| 01-05-2006, 09:01 AM | #2 |
Well, I don't know if you can even detect the armor. I searched for a function to detect armor but didn't find any. I think WEU uses a system based on the agility of the hero, like you said, because by now, there is no other way (or atleast I am not aware of it). I think there is a formula for detecting damage reduced by armor. You could try to cause damage to that unit, and see how much of it is reduced, and so, detect the armor, but not sure about that.... And no, your post is not long at all. ;) ~Daelin |
| 01-05-2006, 02:20 PM | #3 |
The formula can be found here: http://www.battle.net/war3/basics/ar...pontypes.shtml Yes, that would be possible, but it would also introduce a delay. Bigger projects like PR end up storing relevant data not easily accessible in Jass as a global array. |
| 01-05-2006, 02:36 PM | #4 |
Thank you very much Starcraftfreak (oh crap, I gave too much rep today). Tomorrow I'll give you rep for this (I hope I won't forget). Thank you. ~Daelin |
| 01-05-2006, 03:19 PM | #5 |
That formula starcraft freak posted can be found on a more friendly version here http://www.dotaportal.com/forums/ind...showtopic=7870 But, unless there is an event response to check how much damage from an attack was reduced this formula can't be used to calculate the armor value of a unit. Anyway, what i'm trying to do is calculate a unit's armor, use triggers to set it to zero and then put a timer to add armor to it after some time. I'm still having trouble using the advanced triggers from the editor Thanks for the replies. |
| 01-05-2006, 03:34 PM | #6 |
in WEU, they do not return the current armour of the specified unit, but rather how much armor bonus you have added or subtracted from it through the Change Unit's Defense trigger. This trigger uses a lot of object editing to make it possible to change the defense. |
| 01-05-2006, 03:43 PM | #7 |
I thought it would only work that way. Damn. Guess I'll have to brutalize my trigger.. I see a delay coming... Anyway, how about the damage reduced event response? |
