• 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!

Remove Locust unit

Status
Not open for further replies.
The locust unit (SmallHook[]) can't be removed.Game just doesn't removing him.Here is trigger.
Any ideas?
Ty.

  • Set TempPoint = (Position of Caster)
  • Set TempGroup = (Units within 50.00 of TempPoint matching ((Matching unit) equal to SmallHook[integer2]))
  • Set TempTarget = (Random unit from TempGroup)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - conditions
      • TempTarget not equal to no unit
    • Then - action
      • Unit - Remove TempTarget
      • Set integer3 = (integer3 + 1)
    • Else - action
 
Yeah, this is a common thing, this is the solution (I found this out when I was working on my previous spell).


  • Actions
    • Set Group = (Units of type Locust Dummy)
    • Set loc[1] = (Position of Caster)
    • Unit Group - Pick every unit in Group and do (Actions)
      • Loop - Actions
        • Set loc[2] = (Position of (Picked unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between loc[1] and loc[2]) Less than or equal to 50.00
          • Then - Actions
            • Unit - Remove (Picked unit) from the game
            • Set integer3 = (integer3 + 1)
          • Else - Actions
        • Custom script: call RemoveLocation(udg_loc[2])
    • Custom script: call RemoveLocation(udg_loc[1])
    • Custom script: call DestroyGroup(udg_Group)
 
Status
Not open for further replies.
Back
Top