I'd been trying to find a good data solution for critical strike because the trigger-based solutions have always left me with a bad taste in my mouth. The below is the solution I came up with (marked up for SC2 Data Manager).
Narrative: (updated with Feedback from Kueken531)
Unit is given the Critical Strike behavior, which is intuitive for a unit who should have critical strike. This behavior has an attacker-only damage response effect that will apply the bonus damage multiplier behavior (chance)% of the time to the target of the attack. The bonus damage multiplier itself has a damage response to fire an effect to remove the bonus damage multiplier behavior from the target of the attack. This will fire for the same attack that placed the bonus damage multiplier. Because the damage responses fire after the damage is actually calculated or dealt, the bonus damage multiplier behavior take effect (X times the normal incoming damage) then the behavior will be removed and cleaned up so that no other unit or attack will benefit from it.
i just went for a very simple solution because for my map this simple solution will work nicely. essentially i just created a set effect for each of my weapons and added their normal damage effect and then i added a modify unit effect in to the set and changed the chance field to 0.14 (a 1/7 chance of happening) and then set the effect: vitals+ -change fraction field to -0.2. now each of my weapons has a 1/7 chance to do damage equal to 20% of their target's life. side note: the weapons also do their normal damage as well as the "critical" so you may have to do some tweaking with the effect vitals+ field to get the damage to a nice place. like i said earlier this works well for my map, don't know if it would for yours, but it's something to think about. :)
Both your methods need specific requirements to work properly. The method in the first post works, but the interaction with scaled or unscaled bonus damage and other percentage buffs to damage causes your damage on a critical strike to differ from what you would expect. If you adjust your map accordingly and use no unscaled damage bonuses, you can make it work, otherwise something like a 2x crit multiplier would not increase the damage dealt by a factor of 2.
KingRadical's method has more in common with the Crushing Blow mechanic from Diablo 2; the damage is entirely independend of your own damage, also it becomes almost useless on low hp targets, while being immensely useful on high hp ones.
A general data-only critical strike can be achieved by using a Damage Response, applying a 2nd behavior to the target, which also uses a damage response amplifying incoming damage by a fraction and removing itself. Logic dictates, that this method shouldn't work, but it does. The behavior applied by a damage instance already amplifies the damage instance it was applied by, and even if it is also removed by that same damage response, it will still modify the damage correctly. And due to the multiplicative nature of damage responses, it will always amplify the damage dealt by the same fraction.
If you adjust your map accordingly and use no unscaled damage bonuses, you can make it work, otherwise something like a 2x crit multiplier would not increase the damage dealt by a factor of 2.
...
The behavior applied by a damage instance already amplifies the damage instance it was applied by, and even if it is also removed by that same damage response, it will still modify the damage correctly. And due to the multiplicative nature of damage responses, it will always amplify the damage dealt by the same fraction.
Good point on the first one and good idea on the second. I'll revise.
And Funky, I'm not sure who had the idea first, but I agree it's a good idea.
and it's also possible to set the armor multiplicator of the 2nd buff to 0 to have an armor ignoring crit, just like in wc3. if some1 comes up with a dynamic damage response floating text actor thing i would be happy. i know it's easy with triggers to show red numbers.
making critical strike is easy if you just create multiple crit weapons and use buffs to switch out the weapons per level. The biggest and toughest problem i have with critical strike is trying to get the blademaster to animate properly when he is doing a critical strike.. As you know he has a special animation for critical compared to his regular attacks. Now that is really hard for me to figure out.. Basically i can do it, but only with a damage response buff but that causes blademaster to attack twice to trigger a crit. Making the animation look really funky. ( the reason why i needed multiple different weapons is to act as a dummy event for the critical attack animation) But because the damage response buff triggers after the damage is done the weapon switch slightly to late and always looks glitchy (1 cut short attack animation followed by the correct attack/slam animation)
Any ideas how to get critical strike to animate properly on a blademaster? Even if you use a separate damage effect for the critical strike just to give it an actor event it will still look like its glitching the attack/slam because the regular weapon will have him play his standard weapon animation. and if you have more than 1 blademaster on the map both of them would be animation glitching at the same time due to i guess global variables being used instead of locals.
I lost. If it wasnt for all this frustration on getting blademaster to animate his critical strikes properly it would be a really ez ability to make. As in its just a simple weapon with a chance based apply buff before the damage effect. If only it was that ezzzz. The biggest problem is the fact that a regular weapon start event will have him doing a standard attack animation. If you try to put in an actor event that triggers at the same time as "weapon start" it will cause glitching no matter what dummy effect or weapon switch you use because a damage response event only procs after damage is done.
any ideas?
How to make a critistrike that has blademaster animating correctly whenever a critical strike procs.
Can someone please make a critical strike with the data editor for me that has blademaster animating correctly ? and by that i mean Standard animations for normal attack, and Attack/slam for critical strike. ( War3 mod to get HD blademaster) with red floating text for damage with exclamation mark.
Anyone please? I will be able to look at the attached map and see how to do it
they have added native support for critical strike on weapons (there is a field for effect and chance), you dont need a damage response anymore, just work with the effect (i didnt test it)
they have added native support for critical strike on weapons (there is a field for effect and chance), you dont need a damage response anymore, just work with the effect (i didnt test it)
wow thanks, it worked.. Blademaster is animating correctly now with Attack/slam when doing a crit. :D
i didnt even know that they added a field for that in the weapons section. I used to map for sc2 a long time ago and then left for years . When i did map back then i remember that option wasnt there for weapons. Very nice indeed blizzard added the support. I guess they realized it was buggy with damage response buffs set to attacker to achieve the chance effect.
I'd been trying to find a good data solution for critical strike because the trigger-based solutions have always left me with a bad taste in my mouth. The below is the solution I came up with (marked up for SC2 Data Manager).
Narrative: (updated with Feedback from Kueken531)
Unit is given the Critical Strike behavior, which is intuitive for a unit who should have critical strike. This behavior has an attacker-only damage response effect that will apply the bonus damage multiplier behavior (chance)% of the time to the target of the attack. The bonus damage multiplier itself has a damage response to fire an effect to remove the bonus damage multiplier behavior from the target of the attack. This will fire for the same attack that placed the bonus damage multiplier. Because the damage responses fire after the damage is actually calculated or dealt, the bonus damage multiplier behavior take effect (X times the normal incoming damage) then the behavior will be removed and cleaned up so that no other unit or attack will benefit from it.
Features:
Feedback/comments? Improvements?
i just went for a very simple solution because for my map this simple solution will work nicely. essentially i just created a set effect for each of my weapons and added their normal damage effect and then i added a modify unit effect in to the set and changed the chance field to 0.14 (a 1/7 chance of happening) and then set the effect: vitals+ -change fraction field to -0.2. now each of my weapons has a 1/7 chance to do damage equal to 20% of their target's life. side note: the weapons also do their normal damage as well as the "critical" so you may have to do some tweaking with the effect vitals+ field to get the damage to a nice place. like i said earlier this works well for my map, don't know if it would for yours, but it's something to think about. :)
Both your methods need specific requirements to work properly. The method in the first post works, but the interaction with scaled or unscaled bonus damage and other percentage buffs to damage causes your damage on a critical strike to differ from what you would expect. If you adjust your map accordingly and use no unscaled damage bonuses, you can make it work, otherwise something like a 2x crit multiplier would not increase the damage dealt by a factor of 2.
KingRadical's method has more in common with the Crushing Blow mechanic from Diablo 2; the damage is entirely independend of your own damage, also it becomes almost useless on low hp targets, while being immensely useful on high hp ones.
A general data-only critical strike can be achieved by using a Damage Response, applying a 2nd behavior to the target, which also uses a damage response amplifying incoming damage by a fraction and removing itself. Logic dictates, that this method shouldn't work, but it does. The behavior applied by a damage instance already amplifies the damage instance it was applied by, and even if it is also removed by that same damage response, it will still modify the damage correctly. And due to the multiplicative nature of damage responses, it will always amplify the damage dealt by the same fraction.
@Kueken531: Go
wow i never thought about damage response as a solution to critical strike. that's close to genius :d. who had this idea first?
Good point on the first one and good idea on the second. I'll revise.
And Funky, I'm not sure who had the idea first, but I agree it's a good idea.
If its important, the final method was developed by sharf in the irc, I noticed the behavior a couple of months ago myself.
@Kueken531: Go
and it's also possible to set the armor multiplicator of the 2nd buff to 0 to have an armor ignoring crit, just like in wc3. if some1 comes up with a dynamic damage response floating text actor thing i would be happy. i know it's easy with triggers to show red numbers.
making critical strike is easy if you just create multiple crit weapons and use buffs to switch out the weapons per level. The biggest and toughest problem i have with critical strike is trying to get the blademaster to animate properly when he is doing a critical strike.. As you know he has a special animation for critical compared to his regular attacks. Now that is really hard for me to figure out.. Basically i can do it, but only with a damage response buff but that causes blademaster to attack twice to trigger a crit. Making the animation look really funky. ( the reason why i needed multiple different weapons is to act as a dummy event for the critical attack animation) But because the damage response buff triggers after the damage is done the weapon switch slightly to late and always looks glitchy (1 cut short attack animation followed by the correct attack/slam animation)
Any ideas how to get critical strike to animate properly on a blademaster? Even if you use a separate damage effect for the critical strike just to give it an actor event it will still look like its glitching the attack/slam because the regular weapon will have him play his standard weapon animation. and if you have more than 1 blademaster on the map both of them would be animation glitching at the same time due to i guess global variables being used instead of locals.
I lost. If it wasnt for all this frustration on getting blademaster to animate his critical strikes properly it would be a really ez ability to make. As in its just a simple weapon with a chance based apply buff before the damage effect. If only it was that ezzzz. The biggest problem is the fact that a regular weapon start event will have him doing a standard attack animation. If you try to put in an actor event that triggers at the same time as "weapon start" it will cause glitching no matter what dummy effect or weapon switch you use because a damage response event only procs after damage is done.
any ideas? How to make a critistrike that has blademaster animating correctly whenever a critical strike procs.
Can someone please make a critical strike with the data editor for me that has blademaster animating correctly ? and by that i mean Standard animations for normal attack, and Attack/slam for critical strike. ( War3 mod to get HD blademaster) with red floating text for damage with exclamation mark.
Anyone please? I will be able to look at the attached map and see how to do it
@Dangel1234: Go
they have added native support for critical strike on weapons (there is a field for effect and chance), you dont need a damage response anymore, just work with the effect (i didnt test it)
wow thanks, it worked.. Blademaster is animating correctly now with Attack/slam when doing a crit. :D
i didnt even know that they added a field for that in the weapons section. I used to map for sc2 a long time ago and then left for years . When i did map back then i remember that option wasnt there for weapons. Very nice indeed blizzard added the support. I guess they realized it was buggy with damage response buffs set to attacker to achieve the chance effect.
yeah one day it was just there. all the work for nothing