• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Units whiting range of unit type Ability? GUI

Status
Not open for further replies.
Level 6
Joined
Nov 3, 2018
Messages
79
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 73
Joined
Aug 10, 2018
Messages
7,875
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: 5
  • Granite Aura v3.w3m
    28 KB · Views: 6
Status
Not open for further replies.
Top