So the title sounds a bit confusing, but here's what I'm trying to do:
I have an original caster, unit X, who applies a buff behavior to unit Y.
I would like to have the behavior on unit Y be removed if unit Y is out of range of unit X. Range being some arbitrary number.
Why don't you use a simple autocast ability that apply a buff to a unit? For example, you could take the 'heal' ability from the medic, but you could replace the heal effect by an apply behavior. The buff's duration should be of 0.1 seconds and the autocast ability should fire every 0.1 seconds.
Give Unit X a Behavior - Buff which periodically applies an Effect - Search Area with range (the unit's range goes here) that applies an Effect - Apply Behavior linked to your Behavior.
EDIT: Oh I didn't see that the range is an arbitrary number, you could still do this but you'd have to make one for every range possible by the units you have, and give it to every unit.
I could use this, but then I run into this problem...
How do I get unit X to repeatedly choose unit Y?
Many units will be moving in between the two, and often unit X will choose another unit in this process.
The Search Area searches for every unit that qualifies in a set bounds that you can set with filters, there are another set bounds named validators which are used to solo out units with specific behaviors or abilities.
Use a Dummy Behavior and a Behavior validator to solo out Unit Y. You would also need the dummy behavior to have a duration of 1 second or .5 seconds. Then the Search Area will periodically apply the dummy behavior (at a lower rate than the duration of the dummy behavior) as well, so that if Unit Y exits the range and decides to re-enter the range, he wouldn't be affected if he was out long enough (whatever duration you put on the dummy behavior).
If the range that you want the behaviour to be removed is 8 or more then your Location Range validator should be set up so that the Validator - Compare field is Less Than and your Validator - Range field should be 8. The 2 locations to be compared should be Caster Unit of the behaviour and Source Unit of the behaviour.
Hey all!
So the title sounds a bit confusing, but here's what I'm trying to do:
I have an original caster, unit X, who applies a buff behavior to unit Y. I would like to have the behavior on unit Y be removed if unit Y is out of range of unit X. Range being some arbitrary number.
Any help is much appreciated!
Why don't you use a simple autocast ability that apply a buff to a unit? For example, you could take the 'heal' ability from the medic, but you could replace the heal effect by an apply behavior. The buff's duration should be of 0.1 seconds and the autocast ability should fire every 0.1 seconds.
Give Unit X a Behavior - Buff which periodically applies an Effect - Search Area with range (the unit's range goes here) that applies an Effect - Apply Behavior linked to your Behavior.
EDIT: Oh I didn't see that the range is an arbitrary number, you could still do this but you'd have to make one for every range possible by the units you have, and give it to every unit.
@tatatatate: Go
@Necromoni: Go
I could use this, but then I run into this problem...
How do I get unit X to repeatedly choose unit Y? Many units will be moving in between the two, and often unit X will choose another unit in this process.
The Search Area searches for every unit that qualifies in a set bounds that you can set with filters, there are another set bounds named validators which are used to solo out units with specific behaviors or abilities.
Use a Dummy Behavior and a Behavior validator to solo out Unit Y. You would also need the dummy behavior to have a duration of 1 second or .5 seconds. Then the Search Area will periodically apply the dummy behavior (at a lower rate than the duration of the dummy behavior) as well, so that if Unit Y exits the range and decides to re-enter the range, he wouldn't be affected if he was out long enough (whatever duration you put on the dummy behavior).
Else just use a Location Range validator that validates the caster of the effect that applied the buff relative to the source.
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
@DrSuperEvil: Go
This is what I was looking for!
I can't seem to get it to work though. Here's my validator:
Unit: (none): source Other Unit: "Apply Behavior Effect" : Caster Greater than 8
I was looking to get it to remove when the unit is greater than 8 away.
If the range that you want the behaviour to be removed is 8 or more then your Location Range validator should be set up so that the Validator - Compare field is Less Than and your Validator - Range field should be 8. The 2 locations to be compared should be Caster Unit of the behaviour and Source Unit of the behaviour.
Also make sure you're putting the validator on the behavior and not the ability's effects.
And use the field above the value to enable it to use effects higher up in the effect tree as frames of reference.
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