• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Trying to make the unit stop moving

Status
Not open for further replies.
Level 14
Joined
Nov 30, 2013
Messages
926
Hi, I getting trouble making a trigger to make a unit don't move.
But it can move when I test it.

Here's my triggers
  • Villager Var
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Villager[1] = Villager 0010 <gen>
      • Set Villager[2] = Villager 0011 <gen>
      • Set Villager[3] = Villager 0012 <gen>
      • Set Villager[4] = Villager 0013 <gen>
      • Set Villager[5] = Villager 0014 <gen>
  • Villager Control
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Ordered unit)) Equal to (Owner of Villager[(Player number of (Owner of (Ordered unit)))])
          • (Ordered unit) Equal to Villager[(Player number of (Owner of (Ordered unit)))]
          • Villager_Controlled[(Player number of (Owner of (Ordered unit)))] Equal to 0
        • Then - Actions
          • Set Villager_Controlled[(Player number of (Owner of (Ordered unit)))] = 1
          • Unit - Order (Ordered unit) to Stop
          • Set Villager_Controlled[(Player number of (Owner of (Ordered unit)))] = 0
        • Else - Actions
How I can fix that?
 
Level 5
Joined
Jan 27, 2014
Messages
164
Trying pausing/unpausing the unit before and after the stop action.
Also, try replacing all the 'Ordered unit' to 'Triggering unit', just for the fun of it.

Code:
 Set Villager_Controlled[(Player number of (Owner of (Ordered unit)))] = 1
 Unit - Order (Ordered unit) to Stop
 Set Villager_Controlled[(Player number of (Owner of (Ordered unit)))] = 0
^For the integer comparison, you could just replace it with 'Turn off/on (This trigger)' before and after the stop action. It could prevent the infinite loop as well.
 
Status
Not open for further replies.
Top