| 01-08-2007, 10:14 PM | #1 |
Alright, this one should be a bit of a tougher challenge for you experts. I would like to give a hero an 'aura' around them coined The Price of Failure, akin to the necromancer ability from Guild Wars--the premise is that enemy units who miss an attack while in this radius are dealt damage. I understand the basic concept to first apply a buff to enemies in this aura, and then check for that buff, but I am clueless as to how to keep checking without lagging the map, how to deal damage or trigger anything whatsoever based on missing, etc. Thoughts? ![]() |
| 01-08-2007, 11:10 PM | #2 |
You can't detect a miss, so that kinda throws a spanner in the works. There are ways to simulate a miss and then run off of that, but nothing too elegant considering you're not forcing that miss. Someone correct me if I'm mistaken ![]() |
| 01-08-2007, 11:26 PM | #3 |
There's an easy way to do this if you wouldn't mind modifying the aura to also increase the chance for a miss while they're affected. You'd do this by setting an integer variable equal to a value between 1 and 100 and then checking to see if it was equal to 30 or less (for a 30% chance). Then doing your "miss" effects such as adding text, making the unit "miss" and having it take damage. |
| 01-09-2007, 01:07 AM | #4 |
If you want to do it as you said, you'd have to use attackdetect and trigger your evade abilities, then each time a unit misses from any source of evasion check if that buff is on them to deal damage. it's quite a lot of work and totally impractical if you only intend to implement those things for the sake of 1 skill. |
| 01-09-2007, 02:22 AM | #5 |
its not that hard, just as pyrogasm said, that would be the eaysest way. |
| 01-09-2007, 02:48 AM | #6 |
If you'd like, Baron Crinkle, I can post the triggers and possibly a test map here in a few hours. I have company over so I can't work on it now, but I should be able to fiddle with it enough to get it properly working. Unless you can figure it out on your own. ![]() |
| 01-09-2007, 04:03 AM | #7 | |
Quote:
That would be verymuch appreciated. I'm burning through tons of different stuff, have way too much on my to do list for my own good, posting things that stump me on the sidelines in here for expert help. ![]() |
| 01-10-2007, 02:40 AM | #8 |
Aye, I'm working on it as we speak. |
| 01-10-2007, 10:24 AM | #10 |
Like I said, there's no way to detect a regular game miss, so my advice is to focus on another idea, since everything else is either messy or doesn't take all the possibilities into account. |
| 01-10-2007, 11:34 PM | #11 |
Actually, there IS a way to detect it, it's just not efficient or reliable. Just detect when a unit is attacked, get the life of the attacked unit, wait X seconds (as long as the longest time it takes an attack projectile to reach a target in your map), and get the unit's life again. Then subtract the new life from the old life to get another integer; if the number you come up with is less than Y (a bit less than the least damage a unit on the map can do), then the unit missed. I think that might work, though you'd have to use Jass for locals and GetWidgetLife(). |
