I created a simple colliding missile, a fireball, which travels straight forward and explodes on contact with its first target.
I used a buff with a periodic search area effect on the missile unit to achieve this. The missile itself works fine, and so does the impact damage. However my fireball should ignite enemy units, so it applies a buff on impact, which deals damage over time. If a unit dies from this damage over time, it grants no experience or bounty to the unit shooting the fireball.
Further testing showed, that the fireball unit causes the impact damage; which is not a big problem, because the bounty reward goes to the correct player and the missile can have an experience share behavior, that way everything works fine. However the damage of the ignite buff is caused by the target itself, which causes it to suicide, so the xp and bounty is lost.
Furthermore I cannot detect the ability level of the fireball (I usually detect the level per trigger to cause damage according to the current level, instead of creating every single effect multiple times for multiple levels)
Gets tricky here, you need that ignite effect to actually come from the caster of the fireball instead of the fireball missile (since its for all intensive purposes a unit of its own). One way to get around this is to use a trigger firing upon the missile's death that some how knows who created the missile and then, to create the ignite effect within the trigger and aim it back at the original caster. The infestor's terran spawn & spider mines both use a 'killstocaster' behavior that shifts their kill cred back to the caster but in the cast of a DOT effect I'm not sure that'd work since the missile itself is probably long gone throughout the duration.
This gave me an idea. The target unit is the damaging unit only, because the caster (the missile) does not exist anymore. So I increased the death time of the missile to be longer than the buff duration. That way, the damage of the buff is caused by the missile and experience + bounty works again. I will try out the killstocaster thing for correct kill count.
Still need a way to determine the skill level on impact, though... I will try some more.
€ how to add the killstocaster to the missile unit, when it spawns? Some way to execute an effect on the missile spawned by a launch missile effect?
€€ launch effect ;) stupid me
€ does not seem to work... if I use suicide as launch effect, the missiles die instantly, but using KillsToCaster does not transfer the kills properly.
ED: But does launch effect actually work out for you? I found it never worked for me with this.
Because of what I'm doing with missiles I found a not so elegant (but functional) method is to have two event triggers: One that's watching for any time a unit uses the ability and it sets a global variable to that unit, then another event for whenever a missile from that ability is created which takes that global variable and does an 'add the KillsToCaster behavior from LastAbilityUser to missile'.
Its horribly hackish but seems to be a very consistent way to make things work right. The way the generic units use it is directly applying the behavior using an effect within the 'create unit' effect but the 'create missile' effect lacks an equivalently proper mechanism to declare the missile it built to tag it with such an effect.
Well, if I use suicide as launch effect, the missiles die instantly. This proves, that the launch effect is actually executed on the missile. The KillsToCaster Effect however does not work that way.
Ye, sure, I could make very hacky workarounds, I could also just trigger the whole friggin spell. But I am interested in a "correct" data editor solution ;)
€ GOT IT ;)
The launch effect works nicely, however quite counter-intuitive. The effect source unit is the missile, the target or caster unit is the unit casting the missile. So you need an effect, which applies the killstocaster-behavior to the source unit and everything works fine.
I'm starting to wonder then if in the case of the launch effect's pointers that 'caster' is the missile and then possibly 'origin' is the creator. I've asked many times for better clarification of what all of those references mean and so far its been a pretty silent response but I agree I'd love to have a more proper method of doing this sort of thing as well. If you feel like experimenting I'd really recommend yah just copy the suicide effect and screw around with its references to see if you can get it to erase the launcher instead cause then you know how to refer back to the it and that's the key.
Using the searcher on launch effect method eh? I found that worked 99% of the time but that 1% still wasn't good enough. (The missiles I'm creating are sometimes firing at such speeds and quantities that it wasn't catching them all in time)
I'm starting to wonder then if in the case of the launch effect's pointers that 'caster' is the missile and then possibly 'origin' is the creator. I've asked many times for better clarification of what all of those references mean and so far its been a pretty silent response but I agree I'd love to have a more proper method of doing this sort of thing as well. If you feel like experimenting I'd really recommend yah just copy the suicide effect and screw around with its references to see if you can get it to erase the launcher instead cause then you know how to refer back to the it and that's the key.
As edited in my post, the missile is the source, the caster is the caster.
Hey
I created a simple colliding missile, a fireball, which travels straight forward and explodes on contact with its first target.
I used a buff with a periodic search area effect on the missile unit to achieve this. The missile itself works fine, and so does the impact damage. However my fireball should ignite enemy units, so it applies a buff on impact, which deals damage over time. If a unit dies from this damage over time, it grants no experience or bounty to the unit shooting the fireball.
Further testing showed, that the fireball unit causes the impact damage; which is not a big problem, because the bounty reward goes to the correct player and the missile can have an experience share behavior, that way everything works fine. However the damage of the ignite buff is caused by the target itself, which causes it to suicide, so the xp and bounty is lost.
Furthermore I cannot detect the ability level of the fireball (I usually detect the level per trigger to cause damage according to the current level, instead of creating every single effect multiple times for multiple levels)
Any solutions for this?
Gets tricky here, you need that ignite effect to actually come from the caster of the fireball instead of the fireball missile (since its for all intensive purposes a unit of its own). One way to get around this is to use a trigger firing upon the missile's death that some how knows who created the missile and then, to create the ignite effect within the trigger and aim it back at the original caster. The infestor's terran spawn & spider mines both use a 'killstocaster' behavior that shifts their kill cred back to the caster but in the cast of a DOT effect I'm not sure that'd work since the missile itself is probably long gone throughout the duration.
This gave me an idea. The target unit is the damaging unit only, because the caster (the missile) does not exist anymore. So I increased the death time of the missile to be longer than the buff duration. That way, the damage of the buff is caused by the missile and experience + bounty works again. I will try out the killstocaster thing for correct kill count.
Still need a way to determine the skill level on impact, though... I will try some more.
€ how to add the killstocaster to the missile unit, when it spawns? Some way to execute an effect on the missile spawned by a launch missile effect?
€€ launch effect ;) stupid me
€ does not seem to work... if I use suicide as launch effect, the missiles die instantly, but using KillsToCaster does not transfer the kills properly.
@Kueken531: Go
ED: But does launch effect actually work out for you? I found it never worked for me with this.
Because of what I'm doing with missiles I found a not so elegant (but functional) method is to have two event triggers: One that's watching for any time a unit uses the ability and it sets a global variable to that unit, then another event for whenever a missile from that ability is created which takes that global variable and does an 'add the KillsToCaster behavior from LastAbilityUser to missile'.
Its horribly hackish but seems to be a very consistent way to make things work right. The way the generic units use it is directly applying the behavior using an effect within the 'create unit' effect but the 'create missile' effect lacks an equivalently proper mechanism to declare the missile it built to tag it with such an effect.
Well, if I use suicide as launch effect, the missiles die instantly. This proves, that the launch effect is actually executed on the missile. The KillsToCaster Effect however does not work that way.
Ye, sure, I could make very hacky workarounds, I could also just trigger the whole friggin spell. But I am interested in a "correct" data editor solution ;)
€ GOT IT ;)
The launch effect works nicely, however quite counter-intuitive. The effect source unit is the missile, the target or caster unit is the unit casting the missile. So you need an effect, which applies the killstocaster-behavior to the source unit and everything works fine.
@Kueken531: Go
I'm starting to wonder then if in the case of the launch effect's pointers that 'caster' is the missile and then possibly 'origin' is the creator. I've asked many times for better clarification of what all of those references mean and so far its been a pretty silent response but I agree I'd love to have a more proper method of doing this sort of thing as well. If you feel like experimenting I'd really recommend yah just copy the suicide effect and screw around with its references to see if you can get it to erase the launcher instead cause then you know how to refer back to the it and that's the key.
Look at the magister's psi bolt attack for a working implementation.
@RileyStarcraft: Go
Using the searcher on launch effect method eh? I found that worked 99% of the time but that 1% still wasn't good enough. (The missiles I'm creating are sometimes firing at such speeds and quantities that it wasn't catching them all in time)
As edited in my post, the missile is the source, the caster is the caster.
No need anymore ;)
I created an effect, which applies the KillsToCaster - Effect to the source unit and added this as launch effect of the missile.
It works perfectly now, all damage caused by the missile is registered for the caster.
Thanks for all your help :)
@Kueken531: Go
Hah, good stuff yah this should help smooth things out quite a bit :)