I have an actor that spawns when a unit is killed (via way of detecting an effect applied via the death response of a behavior). The problem i'm having is that its spawning for each instance of the effect being activated instead of once per behavior trigger (which is an issue, since potentially there can be many tens of this behavior attached to a single unit). Can i fix this?
I've no idea really if it will work in your particular situation, but it's worth a shot. It probably won't work since I doubt the actor is attached to the killed unit.
If it doesn't, what I'd do is have the actor get created by a separate behavior that can only have one instance on the unit.
Effect.[MySearchAreaEffect].On. I tried Behavior.[MyBehavior].Destroy and Behavior.[MyBehavior].Off but neither were reliable (they seemed to not trigger if the caster of the behavior wasn't the one killing the unit, or something)
You could always give the damage response behavior a cooldown. As all of them are the same and linked to each other only one would fire and the rest would be left in cd.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Well, what I want is each shot to load up another copy of the behavior so that the more times a unit is shot with the ability, the stronger the effect it applies when it dies. So if i add a cooldown, this might break that (and if it doesn't, it would seem odd to have damage coming from an empty spot for who knows how long).
Im not sure thats how death effects work as they only are applied on death so should cancel if a cd. You could always try giving a set effect with a dummy actor spawning effect with charges that is shared for the unit so only one can work.
Maybe have your actor created on unit death and removed when the effect expires?
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I have an actor that spawns when a unit is killed (via way of detecting an effect applied via the death response of a behavior). The problem i'm having is that its spawning for each instance of the effect being activated instead of once per behavior trigger (which is an issue, since potentially there can be many tens of this behavior attached to a single unit). Can i fix this?
Try adding in the actor's Events - Terms: Cap:1
I've no idea really if it will work in your particular situation, but it's worth a shot. It probably won't work since I doubt the actor is attached to the killed unit.
If it doesn't, what I'd do is have the actor get created by a separate behavior that can only have one instance on the unit.
Nope, didn't work. It did fix another semi-related issue i was going to eventually ask about, but not this one ^_^
@RCIX: Go
Well, glad it did something :)
what event are you using to create the actor?
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
Effect.[MySearchAreaEffect].On. I tried Behavior.[MyBehavior].Destroy and Behavior.[MyBehavior].Off but neither were reliable (they seemed to not trigger if the caster of the behavior wasn't the one killing the unit, or something)
Try adding a Cap term to the actor birth?
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
If that's different from what the other guy suggested to me, then you'll have to explain it ^_^
You could always give the damage response behavior a cooldown. As all of them are the same and linked to each other only one would fire and the rest would be left in cd.
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
Well, what I want is each shot to load up another copy of the behavior so that the more times a unit is shot with the ability, the stronger the effect it applies when it dies. So if i add a cooldown, this might break that (and if it doesn't, it would seem odd to have damage coming from an empty spot for who knows how long).
Im not sure thats how death effects work as they only are applied on death so should cancel if a cd. You could always try giving a set effect with a dummy actor spawning effect with charges that is shared for the unit so only one can work.
Maybe have your actor created on unit death and removed when the effect expires?
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