• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Units whiting range of unit type Ability? GUI

Level 5
Joined
Nov 3, 2018
Messages
80
Group 6 checks for units with a specific buff
Group 6 checks for units without a specific buff
Supervisor Rango is the buff's name.
This works and it should be leakless but is there a more efficient way? i feel that picking all the units in the map of a player every 1 second would had a negative performance impact

1711580631123.png


What i want to achieve is that units whitin a certain range of a unit type gets an ability and that as soon it leaves the range it loses the ability
also i'm not sure if there is any negative side effects to having units constantly getting added an ability or the game just does not do anything when it detects the ability is already in the unit , but this is the only way i could think of in a gui WAY to achieve this any suggestion is welcome!
1711580760326.png
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
What you're describing is an Aura. I attached some maps I made that showcase how to trigger one yourself.

But honestly your solution might very well be better, although you could further improve it by using one Unit Group of "Units owned by Zerg", then Loop over it to see if they have the buff or not by using an If Then Else action. As it is now, you're looping over ALL of the units owned by Zerg twice.

To answer your question, there won't be any negative side effects, the code detects a duplicate Ability ID and returns out of the function before adding it again.
 

Attachments

  • Mana Drain Aura NonHero.w3m
    25.7 KB · Views: 0
  • Granite Aura v3.w3m
    28 KB · Views: 1
Top