• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Units whiting range of unit type Ability? GUI

Status
Not open for further replies.
Level 7
Joined
Nov 3, 2018
Messages
99
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
 
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

Status
Not open for further replies.
Back
Top