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

Remove Locust unit

Status
Not open for further replies.
Level 15
Joined
Dec 6, 2008
Messages
345
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
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
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.
Top