• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Remove Locust unit

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

  • 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
Level 28
Jan 26, 2007
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)
Not open for further replies.