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

Stopping units from moving

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
Hello I am trying to make it so if the user orders a few specific units that are already placed on the map to move/attack they don't move, they just keep standing. I tried this:

  • MoveCancel
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering unit) Equal to Knight 0011 <gen>
              • (Triggering unit) Equal to Priest 0012 <gen>
              • (Triggering unit) Equal to HeroKnight 0015 <gen>
        • Then - Actions
          • Unit - Order (Ordered unit) to Stop
          • Else - Actions


But it doesn't do anything. Anyone have a suggestion?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
This works for me right now!

However,
If more than one person should do this at a time would this bug?

  • MoveCancel
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering unit) Equal to Knight 0011 <gen>
              • (Triggering unit) Equal to Priest 0012 <gen>
              • (Triggering unit) Equal to HeroKnight 0015 <gen>
        • Then - Actions
          • Set HeroStop = (Triggering unit)
          • Countdown Timer - Start HeroStopTimer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
  • HeroStopTimer
    • Events
      • Time - HeroStopTimer expires
    • Conditions
    • Actions
      • Unit - Order HeroStop to Stop
      • Set HeroStop = No unit
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Is this what you mean?

  • MoveCancel
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering unit) Equal to Knight 0012 <gen>
              • (Triggering unit) Equal to Priest 0013 <gen>
              • (Triggering unit) Equal to HeroKnight 0015 <gen>
        • Then - Actions
          • Unit Group - Add (Triggering unit) to HeroStop_UnitGroup
          • Countdown Timer - Start HeroStopTimer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
  • HeroStopTimer
    • Events
      • Time - HeroStopTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HeroStop_UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Stop
          • Unit Group - Remove (Picked unit) from HeroStop_UnitGroup
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Is this what you mean?

  • MoveCancel
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering unit) Equal to Knight 0012 <gen>
              • (Triggering unit) Equal to Priest 0013 <gen>
              • (Triggering unit) Equal to HeroKnight 0015 <gen>
        • Then - Actions
          • Unit Group - Add (Triggering unit) to HeroStop_UnitGroup
          • Countdown Timer - Start HeroStopTimer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
  • HeroStopTimer
    • Events
      • Time - HeroStopTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HeroStop_UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Stop
          • Unit Group - Remove (Picked unit) from HeroStop_UnitGroup

Yes, it looks better.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Maker, if using a Wait of 0.00 second, no matter how many units are there, it won't bug up.
Mind to explain why this is happening ?
Perhaps it's the cause of (Triggering unit) maybe.

Yes, it is because Triggering unit. Triggering unit isn't overwritten by the next instance of the trigger.

Using a wait results in a small delay that can be noticed. That is why a timer is better.
 
Status
Not open for further replies.
Top