• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

how do i stop a unit when it attempts to move

Status
Not open for further replies.
Level 12
Joined
Mar 21, 2008
Messages
358
apparently this doesn't work, unit just ends up moving anyway

  • trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(smart))
    • Actions
      • Unit - Order (Ordered unit) to Stop
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
That trigger fails because the stop actually takes effect before the smart order.

This will work:
  • Untitled Trigger 026
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(smart))
    • Actions
      • Set p1 = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of issued order) Not equal to No unit
        • Then - Actions
          • Set p2 = (Position of (Target unit of issued order))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target item of issued order) Not equal to No item
            • Then - Actions
              • Set p2 = (Position of (Target item of issued order))
            • Else - Actions
              • Set p2 = (Target point of issued order)
      • Unit Group - Add (Triggering unit) to group
      • Countdown Timer - Start Timer1 as a One-shot timer that will expire in 0.00 seconds
      • Hashtable - Save (Angle from p1 to p2) as (Key angle) of (Key (Triggering unit)) in Hash
      • Custom script: call RemoveLocation(udg_p1)
      • Custom script: call RemoveLocation(udg_p2)
  • Untitled Trigger 039
    • Events
      • Time - Timer1 expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Stop
          • Unit Group - Remove (Picked unit) from group
          • Unit - Make (Picked unit) face (Load (Key angle) of (Key (Picked unit)) from Hash) over 0.00 seconds
 
Last edited:
Level 8
Joined
Mar 26, 2009
Messages
301
You want it to rotate but now move? Simple; create a dummy and cast entangle on desired unit =)
Remove special effects from object editor if you want. (ability: Entangling Roots, Night Elf - Unit Ability)
Set duration to 0 to make it permanent; and when you want to make it move again, use "remove specific buff" in trigger editor =)
 
Status
Not open for further replies.
Top