I want to find a way to create an effect on a unit every time it comes within range of another unit, and that it doesn't apply it again until the other unit has left and returned within range. This is then supposed to apply for all units.
I thought of using a behavior, since it means less lag once the unit count goes up, but I don't know where to begin. D:
Does anyone have an idea or any suggestions? It would be very much appreciated!
I would go for a basic aura approach.
Use a Behavior on the other unit, which executes a Search effect at a short period (0.25 seconds is used by Blizzard). This search executes an Apply Behavior effect, which applies another behavior on the targets.
This 2nd behavior has a duration slightly longer than the period (0.5 seconds) and uses the effect you actually want to apply as its Effect - Initial.
This effect will only be executed, when the behavior is applied; not, when it is refreshed. So it will only be re-executed, if the target loses the behavior and gets it again (aka moves out of range and then back in).
Depending on your application, you can also use the aura on the main unit, apply the 2nd behavior on the other unit and execute the initial effect back on the first unit by setting its target location to Caster- or Origin Unit
I want to find a way to create an effect on a unit every time it comes within range of another unit, and that it doesn't apply it again until the other unit has left and returned within range. This is then supposed to apply for all units.
I thought of using a behavior, since it means less lag once the unit count goes up, but I don't know where to begin. D: Does anyone have an idea or any suggestions? It would be very much appreciated!
I would go for a basic aura approach.
Use a Behavior on the other unit, which executes a Search effect at a short period (0.25 seconds is used by Blizzard). This search executes an Apply Behavior effect, which applies another behavior on the targets.
This 2nd behavior has a duration slightly longer than the period (0.5 seconds) and uses the effect you actually want to apply as its Effect - Initial.
This effect will only be executed, when the behavior is applied; not, when it is refreshed. So it will only be re-executed, if the target loses the behavior and gets it again (aka moves out of range and then back in).
Depending on your application, you can also use the aura on the main unit, apply the 2nd behavior on the other unit and execute the initial effect back on the first unit by setting its target location to Caster- or Origin Unit
@Kueken531: Go
Good idea! :D I'll try that. Thx alot. :>
I will build a temple in your honor.
You could also use an Enumerate Area validator depending on what sort of effect you want to apply.
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