I have a behavior that uses the Damage Response field. It applies a damage effect when the unit attacks. Everything works as intended unless the damage effect of the damage response kills the enemy unit. In this case the unit seems to die twice. It grants double experience, increases the unit's kill count by 2 and causes unit dies triggers to run twice.
I guess it's because you apply two damage effects at the same time (the normal weapon damage + the damage response effect).
Any ideas how to solve this problem? Maybe a validator or a kill/death field I didn't see?
It's very easy to reproduce this issue: Create a Buff behavior, set Damage Response chance to 1, location to Attacker and Handled to Kill (Generic Kill Command) and add this behavior to any unit.
If you add a Persistent effect to the damage response and use it to instantly apply multiple damage effects, can you generate additional kills?
A 0.0625 delay via the Persistent should fix the issue, but might cause issues in a highly competitive setting (wait 1 game tick for the unit to be declared dead before triggering the additional damage)
Instantly applying the damage via persistent still generate additional kills. Adding a delay does help. This isn't the best solution because you can see the delay but I couldn't find a better solution. Thanks for your help. And if anyone knows a better way without a delay replies are still welcome.
The question was, does applying more than one damage effect via Persistent/Set generate more than one extra kill? This probably won't affect the possible solutions, but there's a difference between the damage response sneaking in and registering the unit twice and every effect generating its own "kill" within that window.
Also try applying an effect that prevents kill credit in either attack chain and check the number of kills, that could help identify which effect is processed first.
The question was, does applying more than one damage effect via Persistent/Set generate more than one extra kill? This probably won't affect the possible solutions, but there's a difference between the damage response sneaking in and registering the unit twice and every effect generating its own "kill" within that window.
I tested a set with multiple damage effects but it won't add extra kills. So I guess only the damage response adds an extra kill.
Also try applying an effect that prevents kill credit in either attack chain and check the number of kills, that could help identify which effect is processed first.
I'm not sure what you mean. How do I do that?
edit: I've found another way doing that because of your set idea. I created a set for the units that could have this behavior. I put in both damage effects and an apply behavior to add the cooldown of the extra damage effect. Then I've added validators to check if this effect is on cooldown/has the dummy cooldown behavior and if the unit has the behavior to use this effect.
I have a behavior that uses the Damage Response field. It applies a damage effect when the unit attacks. Everything works as intended unless the damage effect of the damage response kills the enemy unit. In this case the unit seems to die twice. It grants double experience, increases the unit's kill count by 2 and causes unit dies triggers to run twice.
I guess it's because you apply two damage effects at the same time (the normal weapon damage + the damage response effect). Any ideas how to solve this problem? Maybe a validator or a kill/death field I didn't see?
It's very easy to reproduce this issue: Create a Buff behavior, set Damage Response chance to 1, location to Attacker and Handled to Kill (Generic Kill Command) and add this behavior to any unit.
Try the "Target not Dead" validator on the effect(s) produced by the damage response?
@Photoloss: Go
I tested both effects but it didn't change anything.
If you add a Persistent effect to the damage response and use it to instantly apply multiple damage effects, can you generate additional kills?
A 0.0625 delay via the Persistent should fix the issue, but might cause issues in a highly competitive setting (wait 1 game tick for the unit to be declared dead before triggering the additional damage)
Instantly applying the damage via persistent still generate additional kills. Adding a delay does help. This isn't the best solution because you can see the delay but I couldn't find a better solution. Thanks for your help. And if anyone knows a better way without a delay replies are still welcome.
The question was, does applying more than one damage effect via Persistent/Set generate more than one extra kill? This probably won't affect the possible solutions, but there's a difference between the damage response sneaking in and registering the unit twice and every effect generating its own "kill" within that window.
Also try applying an effect that prevents kill credit in either attack chain and check the number of kills, that could help identify which effect is processed first.
I tested a set with multiple damage effects but it won't add extra kills. So I guess only the damage response adds an extra kill.
I'm not sure what you mean. How do I do that?
edit: I've found another way doing that because of your set idea. I created a set for the units that could have this behavior. I put in both damage effects and an apply behavior to add the cooldown of the extra damage effect. Then I've added validators to check if this effect is on cooldown/has the dummy cooldown behavior and if the unit has the behavior to use this effect.
You could set the initial damage instance to no kill.