HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Somewhat tricky aura idea--but how to execute it?

01-08-2007, 10:14 PM#1
Baron Crinkle
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
Mezzer
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
Pyrogasm
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
grim001
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
Feroc1ty
its not that hard, just as pyrogasm said, that would be the eaysest way.
01-09-2007, 02:48 AM#6
Pyrogasm
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
Baron Crinkle
Quote:
Originally Posted by Pyrogasm
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.


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
Pyrogasm
Aye, I'm working on it as we speak.
01-10-2007, 04:09 AM#9
Pyrogasm
Dunno if this counts as a double post...

So, I finished this aura with only two minor problems. The trigger won't run if a unit genuinely misses (without the aid of the trigger), and the credit for killing the unit goes to whatever unit was attacked originally, not necessasarily the owner of the hero with the aura.

There is a check in the trigger to see if the unit was originally ordered to attack a specific unit (becuase I have to tell it to stop) and if so it will again order it to attack the unit it was attacking originally; if it was not ordered to directly attack something then it will just idly attack things. If you want, you can include redirects for patrol and attack-move, just follow what I did for the others.

Here's the trigger, the map is attached.
Trigger:
The Price of Failure
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Attacking unit) has buff The Price of Failure (Level 1)) Equal to True
((Attacking unit) has buff The Price of Failure (Level 2)) Equal to True
((Attacking unit) has buff The Price of Failure (Level 3)) Equal to True
Collapse Actions
Set Failure_Chance = (Random integer number between 1 and 10)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacking unit) has buff The Price of Failure (Level 1)) Equal to True
Collapse Then - Actions
If (Failure_Chance Less than or equal to 1) then do (Do nothing) else do (Skip remaining actions)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacking unit) has buff The Price of Failure (Level 2)) Equal to True
Collapse Then - Actions
If (Failure_Chance Less than or equal to 2) then do (Do nothing) else do (Skip remaining actions)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacking unit) has buff The Price of Failure (Level 3)) Equal to True
Collapse Then - Actions
If (Failure_Chance Less than or equal to 3) then do (Do nothing) else do (Skip remaining actions)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Current order of (Attacking unit)) Equal to (Order(attack))
Collapse Then - Actions
Unit - Order (Attacking unit) to Stop
Animation - Play (Attacking unit)'s attack animation
Unit - Order (Attacking unit) to Attack (Triggering unit)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Current order of (Attacking unit)) Not equal to (Order(attack))
Collapse Then - Actions
Unit - Order (Attacking unit) to Stop
Animation - Play (Attacking unit)'s attack animation
Collapse Else - Actions
Do nothing
If (((Attacking unit) has buff The Price of Failure (Level 1)) Equal to True) then do (Unit - Cause (Triggering unit) to damage (Attacking unit), dealing 30.00 damage of attack type Normal and damage type Normal) else do (If (((Attacking unit) has buff The Price of Failure (Level 2)) Equal to True) then do (Unit - Cause (Triggering unit) to damage (Attacking unit), dealing 60.00 damage of attack type Normal and damage type Normal) else do (If (((Attacking unit) has buff The P
Floating Text - Create floating text that reads Miss! above (Attacking unit) with Z offset 30.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 1.75 seconds
Floating Text - Change (Last created floating text): Disable permanence
Attached Files
File type: w3xThe Price of Failure.w3x (20.6 KB)
01-10-2007, 10:24 AM#10
Mezzer
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
Pyrogasm
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().