• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Event - Condition that determines if a hero is close to another

Status
Not open for further replies.
  • Set Temp_Point = (Position of (*your hero*))
  • Set Temp_Group = (Units within *range* of Temp_Point matching (((Matching unit) is A Hero) Equal to True))
  • -------- Remove memory leak: --------
  • Custom script: call RemoveLocation(udg_Temp_Point)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Temp_Group) Greater than 0
    • Then - Actions
      • -------- There is a hero in range --------
    • Else - Actions
      • -------- There is NOT a hero in range --------
  • -------- Remove memory leak: --------
  • Custom script: call DestroyGroup(udg_Temp_Group)
 
  • Set Temp_Point = (Position of (*your hero*))
  • Set Temp_Group = (Units within *range* of Temp_Point matching (((Matching unit) is A Hero) Equal to True))
  • -------- Remove memory leak: --------
  • Custom script: call RemoveLocation(udg_Temp_Point)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Temp_Group) Greater than 0
    • Then - Actions
      • -------- There is a hero in range --------
    • Else - Actions
      • -------- There is NOT a hero in range --------
  • -------- Remove memory leak: --------
  • Custom script: call DestroyGroup(udg_Temp_Group)
This will always return true as the group pick also picks the hero itself, so it makes a check "Unit_001 is withing X range of Unit_001" which is always true.
 
Last edited:
Is there a way to detect if a hero is near another hero like in that heros vicinity?

Pick each unit around each hero. Check if picked unit is hero. If yes, profit. Otherwise nothing

Its more complex if you're searching for the nearest hero near target hero, but it's also easily doable. Only more conditions.
 
Status
Not open for further replies.
Back
Top