Like that title says, I'm trying to set up an add behavior-buff system where it only adds the buff to the killing unit when certain units dies, without using triggers. As most of the map is based around killing these units, I don't think using triggers is the way to go. I already have quite a few triggers already, and I don't need 1 of 3 activating every time 1 of 12 players kills a unit. With abilities that are planned that will have splash damage, could easily have these triggers going off 30+ times at the same time.
As hinted above, the solution is simply a death response buff behaviour. Give it to the dying units. In response to fatal damage make them use an add behaviour effect on the killing unit which adds your behaviour. If you want it to give variable buffs to the killing unit then use a switch effect to resolve which add behaviour effect to use.
That said firing 30 triggers at the same time is trivial as long as the triggers are trivial. Triggers only cause poor performance if there are either several hundred firing or some have non trivial tasks. An example of 1 trigger causing performance problems could be some form of physics system which has 1 trigger firing per frame which performs collision and displacement on 100 or more objects. On the other hand hundreds of triggers firing in response to some large AoE ability which then go onto compute some form of base placement (say for a graveyard tombstone system) could cause performance problems.
Although I agree that data is the way to go for this solution (anything else is silly) but do not try to over-optimize triggers thinking that they will cause performance problems. You might find in the end that all your triggers are trivial compared with the amount of time the game spends moving units around the map (the most common source of performance problems in SC2) so you would have made your life difficult and gained nothing at all.
The data editor is a total mess, its very hard to use. Triggers aren't that bad, only intensive triggers are bad. It should be okay to fire off simple triggers as often as you like.
Anyways, death response seems like the correct answer, but I'm looking at the death response field. And I recall needing this before and death response doesn't work.
What you need to do is use DAMAGE RESPONSE.
In the Damage Response - Fatal field, enable that.
In the Damage Response - Location, change that to attacker.
In the Damage Response - Handled, put your apply behavior effect.
In the Damage Response - Chance, set that to 1.
This should allow you to apply whatever behavior you wish to the killing unit.
OR you can just use a trigger to do that. But data editing is probably better in this case...by a slight margin.
Thanks for the responses. I tired both a death response and a damage response. I'm not the greatest at making maps or using the data editor. Long story short, neither seemed to work. I'm pretty sure I had them set up correctly and in single player testing I got zilch.
I guess I'll just use triggers for it, been playing with those since SC1, seems to be so much easier then the rest of the SC2 editor.
So, I had to come back to it cause the triggers I set up weren't working correctly. After a little more research I discovered your method actually works Sandround with the exception of 1 thing. The location needs to be set to defender. When I did that the response worked perfectly.
Like that title says, I'm trying to set up an add behavior-buff system where it only adds the buff to the killing unit when certain units dies, without using triggers. As most of the map is based around killing these units, I don't think using triggers is the way to go. I already have quite a few triggers already, and I don't need 1 of 3 activating every time 1 of 12 players kills a unit. With abilities that are planned that will have splash damage, could easily have these triggers going off 30+ times at the same time.
Why not use a death response buff.
As hinted above, the solution is simply a death response buff behaviour. Give it to the dying units. In response to fatal damage make them use an add behaviour effect on the killing unit which adds your behaviour. If you want it to give variable buffs to the killing unit then use a switch effect to resolve which add behaviour effect to use.
That said firing 30 triggers at the same time is trivial as long as the triggers are trivial. Triggers only cause poor performance if there are either several hundred firing or some have non trivial tasks. An example of 1 trigger causing performance problems could be some form of physics system which has 1 trigger firing per frame which performs collision and displacement on 100 or more objects. On the other hand hundreds of triggers firing in response to some large AoE ability which then go onto compute some form of base placement (say for a graveyard tombstone system) could cause performance problems.
Although I agree that data is the way to go for this solution (anything else is silly) but do not try to over-optimize triggers thinking that they will cause performance problems. You might find in the end that all your triggers are trivial compared with the amount of time the game spends moving units around the map (the most common source of performance problems in SC2) so you would have made your life difficult and gained nothing at all.
The data editor is a total mess, its very hard to use. Triggers aren't that bad, only intensive triggers are bad. It should be okay to fire off simple triggers as often as you like.
Anyways, death response seems like the correct answer, but I'm looking at the death response field. And I recall needing this before and death response doesn't work.
What you need to do is use DAMAGE RESPONSE.
In the Damage Response - Fatal field, enable that.
In the Damage Response - Location, change that to attacker.
In the Damage Response - Handled, put your apply behavior effect.
In the Damage Response - Chance, set that to 1.
This should allow you to apply whatever behavior you wish to the killing unit.
OR you can just use a trigger to do that. But data editing is probably better in this case...by a slight margin.
Thanks for the responses. I tired both a death response and a damage response. I'm not the greatest at making maps or using the data editor. Long story short, neither seemed to work. I'm pretty sure I had them set up correctly and in single player testing I got zilch.
I guess I'll just use triggers for it, been playing with those since SC1, seems to be so much easier then the rest of the SC2 editor.
death response works pretty well, you can also use the effect fields on the units, there is one for death.
So, I had to come back to it cause the triggers I set up weren't working correctly. After a little more research I discovered your method actually works Sandround with the exception of 1 thing. The location needs to be set to defender. When I did that the response worked perfectly.
You could also just use the loot system.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg