- Joined
- Jan 12, 2010
- Messages
- 13
Problem tracking If a Ranged Unit finished it's attack animation
Hello fellow forum members.
EDIT: With the help of some of you, I Managed to track if the unit has moved in the past few seconds. However, the problem isn't solved =/. Thx for the Help anyway
EDIT2: Problem Solved, thanks to the guy who suggested me to use Damage Detection System. It wasn't even necessary to implement the Missile Detect system. Thanks to everyone who tried to Help me, the case is Solved =D.
I'll leave the Solution below, so if you ever need it you can use it as you please.
(PDD System used - http://www.hiveworkshop.com/forums/spells-569/physical-damage-detection-gui-v1-2-0-1-a-231846/)
Trigger 1:
I'm having a little problem with a trigger of mine in wich I'm trying to track if a certain unit has attacked and moved afterwards. Thing is, the said unit is a Player-controlled Hero, and thus people can order a unit to attack someone and cancel this order right before the animation is finished (The trigger can detect if someone started to attack a target, but don't check if the attack was successful), and the attack animation and damage aren't done.
The reason why I'm trying to check this condition is because I've made a spell called "Flanking Maneuvers". That spell would deal bonus damage to a target unit if the owner of this ability ordered to move as soon as he attacked it's target, like a "Hit-and-run" bonus. Any Ideas how to fix / make this work?
Hello fellow forum members.
EDIT: With the help of some of you, I Managed to track if the unit has moved in the past few seconds. However, the problem isn't solved =/. Thx for the Help anyway
EDIT2: Problem Solved, thanks to the guy who suggested me to use Damage Detection System. It wasn't even necessary to implement the Missile Detect system. Thanks to everyone who tried to Help me, the case is Solved =D.
I'll leave the Solution below, so if you ever need it you can use it as you please.
(PDD System used - http://www.hiveworkshop.com/forums/spells-569/physical-damage-detection-gui-v1-2-0-1-a-231846/)
Trigger 1:
-
Skill Flanking Maneuver
-
Events
- Unit - A unit Is attacked
-
Conditions
- (Level of Flanking Maneuver for (Attacking unit)) Not equal to 0
- ((Attacked unit) is A structure) Equal to False
-
Actions
- -------- Setting who's the attacking and attacked Unit --------
- Set Flanking_units[1] = (Attacking unit)
- Set Flanking_units[2] = (Attacked unit)
- -------- Setting the Attacking unit's position for later analysis if it has moved --------
- Set Flanking_position[1] = (Position of Flanking_units[1])
- -------- Setting the Bonus Damage if the Unit Successfully "Flanked" --------
- Set Flanking_Damage = (((Real((Level of Flanking Maneuver for Flanking_units[1]))) x 15.00) + (0.05 x (Current movement speed of Flanking_units[1])))
- -------- Waiting Event to check for new Position of Attacking unit --------
- Wait 0.80 seconds
- -------- The next Condition is a Real Comparision, to make sure the Attacking Unit has moved --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((X of Flanking_position[1]) Not equal to (X of (Position of Flanking_units[1]))) or ((Y of Flanking_position[1]) Not equal to (Y of (Position of Flanking_units[1])))
-
Then - Actions
- -------- At this point, I'm using Custom Value of unit instead of a Boolean Variable --------
- Unit - Set the custom value of Flanking_units[1] to 1
- -------- Removing Memory Leak --------
- Custom script: call RemoveLocation(udg_Flanking_position[1])
- Else - Actions
-
If - Conditions
-
Events
-
Skill Flanking Damage
-
Events
- Game - PDD_damageEventTrigger becomes Equal to 1.00
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PDD_damageType Equal to PDD_PHYSICAL
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PDD_source Equal to Flanking_units[1]
- PDD_target Equal to Flanking_units[2]
- (Custom value of Flanking_units[1]) Equal to 1
-
Then - Actions
- -------- The Previous Conditions are related to the PDD System, and they make sure that the Flanking target took damage --------
- -------- Setting Special effect that will play in the attacked unit, if it is sucessfully "Flanked" --------
- Special Effect - Create a special effect attached to the chest of (Triggering unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
- Special Effect - Destroy (Last created special effect)
- -------- Setting the bonus damage caused to the Flanked unit --------
- Unit - Cause Flanking_units[1] to damage (Triggering unit), dealing Flanking_Damage damage of attack type Hero and damage type Normal
- -------- Just a floating text to show up with the damage bonus value --------
- Floating Text - Create floating text that reads (+ + ((String((Integer(Flanking_Damage)))) + !)) above PDD_target with Z offset 0.00, using font size 10.00, color (90.00%, 10.00%, 10.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
- -------- Setting the Custom value to 0 again, so everything will have to be checked again --------
- Unit - Set the custom value of Flanking_units[1] to 0
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
I'm having a little problem with a trigger of mine in wich I'm trying to track if a certain unit has attacked and moved afterwards. Thing is, the said unit is a Player-controlled Hero, and thus people can order a unit to attack someone and cancel this order right before the animation is finished (The trigger can detect if someone started to attack a target, but don't check if the attack was successful), and the attack animation and damage aren't done.
The reason why I'm trying to check this condition is because I've made a spell called "Flanking Maneuvers". That spell would deal bonus damage to a target unit if the owner of this ability ordered to move as soon as he attacked it's target, like a "Hit-and-run" bonus. Any Ideas how to fix / make this work?
Attachments
Last edited: