Nenad
~Choco Coronet~ Omnomnom
- Reaction score
- 137
This question comes up at least once a week, and since everyone on TH helped me resolve it, why not put it here, so we avoid any more needless posts.
First of all, you will need this:
http://www.thehelper.net/forums/showthread.php?t=137957&highlight=Damage+detection+system
It is Very user friendly, completely GUI. Follow the instructions on the said thread to find out how to place it in your map.
Now, say you want to do something when your hero Blocks/Evades/Parries. It's the same effect, your hero does not take damage, that's the bottom line.
First, Find hardened skin under abilities/night elf/units in the object editor. Copy this ability and paste it so you get a custom ability you can work on (not necessary, it's my personal choice, so if you make multiple spells you always have the same base).
Now, Check if it's a unit/object or hero ability depending on what you're working on. What is very handy with the hardened skin is two things.
1) There is a % chance to reduce damage, which for us means a % chance to evade/block/parry.
2) There is a Minimum Damage data field and an Ignored damage data field. You change the minimum damage field to 0.04 and set the ignored damage field to 99999.
Then Trigger is simply this:
A little explanation on how it works. GDD_Event is a Game - Value of a real variable event. You just put the GDD_Event as you're variable and leave it at 0.00. This trigger then fires when the unit takes damage.
In this example, we are using Block as a skill. So, the first condition is A Integer Comparison - Level of ability (Your hardened skin ability, which is block here) for the unit. It has to be greater than 0 so we know the unit has the ability. Knowing that it has the ability, this trigger won't fire off needlessly if the unit did not take the said ability.
GDD_Damage is a real variable. Use the Real Comparison and Set it to Less than 0.08 and more than 0.00. This value is so precise, that it will only fire off when the Hardened skin effect happens. This range is due to the multiple armor types being able to reduce damage further, as Weep pointed out. If you are not using multiple armor types, feel free to lessen the range! x)
The last part of the trigger is just the floating text. It looks exactly the same like the in-game Miss! , just change the Blocked! to anything you want.
This is leakless, MUI MPI and any other acronym you may find ^^
Now you can make any ability that you want, that fires of when the unit Blocks/Evades/Parries. For example, the said ability above can have a counter that will deal damage to the attacking unit, and the trigger would look like this.
Feel free to experiment with this, and hopefully you will look here before posting another thread about it.
If anyone has anything to add to this, i will edit this post. I need no rep for this, all of these things were done by people at TH, just thought I'd summarize it all for clarification ^^
Credits: the the Immortal for the idea, Weep for the damage system. ^^
Increased the Range of damage to compensate for the armor system. - Weep
How to use GUI to trigger Evade, Block, Miss and More.
First of all, you will need this:
http://www.thehelper.net/forums/showthread.php?t=137957&highlight=Damage+detection+system
It is Very user friendly, completely GUI. Follow the instructions on the said thread to find out how to place it in your map.
Now, say you want to do something when your hero Blocks/Evades/Parries. It's the same effect, your hero does not take damage, that's the bottom line.
First, Find hardened skin under abilities/night elf/units in the object editor. Copy this ability and paste it so you get a custom ability you can work on (not necessary, it's my personal choice, so if you make multiple spells you always have the same base).
Now, Check if it's a unit/object or hero ability depending on what you're working on. What is very handy with the hardened skin is two things.
1) There is a % chance to reduce damage, which for us means a % chance to evade/block/parry.
2) There is a Minimum Damage data field and an Ignored damage data field. You change the minimum damage field to 0.04 and set the ignored damage field to 99999.
Then Trigger is simply this:
Trigger:
- Block
- Events
- Game - GDD_Event becomes Equal to 0.00
- Conditions
- (Level of Block for GDD_DamagedUnit) Greater than 0
- GDD_Damage Less than or equal to 0.08
- GDD_Damage Greater than 0.00
- Actions
- Set TempPoint = (Position of GDD_DamagedUnit)
- Floating Text - Create floating text that reads Blocked! at TempPoint with Z offset 0.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 50.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Custom script: call RemoveLocation(udg_TempPoint)
- Events
A little explanation on how it works. GDD_Event is a Game - Value of a real variable event. You just put the GDD_Event as you're variable and leave it at 0.00. This trigger then fires when the unit takes damage.
In this example, we are using Block as a skill. So, the first condition is A Integer Comparison - Level of ability (Your hardened skin ability, which is block here) for the unit. It has to be greater than 0 so we know the unit has the ability. Knowing that it has the ability, this trigger won't fire off needlessly if the unit did not take the said ability.
GDD_Damage is a real variable. Use the Real Comparison and Set it to Less than 0.08 and more than 0.00. This value is so precise, that it will only fire off when the Hardened skin effect happens. This range is due to the multiple armor types being able to reduce damage further, as Weep pointed out. If you are not using multiple armor types, feel free to lessen the range! x)
The last part of the trigger is just the floating text. It looks exactly the same like the in-game Miss! , just change the Blocked! to anything you want.
This is leakless, MUI MPI and any other acronym you may find ^^
Now you can make any ability that you want, that fires of when the unit Blocks/Evades/Parries. For example, the said ability above can have a counter that will deal damage to the attacking unit, and the trigger would look like this.
Trigger:
- Block
- Events
- Game - GDD_Event becomes Equal to 0.00
- Conditions
- (Level of Block for GDD_DamagedUnit) Greater than 0
- GDD_Damage Less than or equal to 0.08
- GDD_Damage Greater than 0.00
- Actions
- Set TempPoint = (Position of GDD_DamagedUnit)
- Floating Text - Create floating text that reads Blocked! at TempPoint with Z offset 0.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 50.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Custom script: call RemoveLocation(udg_TempPoint)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (GDD_DamagedUnit is in DefendGroup) Equal to True
- Then - Actions
- Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing 40.00 damage of attack type Chaos and damage type Universal
- Else - Actions
- If - Conditions
- Events
Feel free to experiment with this, and hopefully you will look here before posting another thread about it.
If anyone has anything to add to this, i will edit this post. I need no rep for this, all of these things were done by people at TH, just thought I'd summarize it all for clarification ^^
Credits: the the Immortal for the idea, Weep for the damage system. ^^
Increased the Range of damage to compensate for the armor system. - Weep