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

Right-click, stop issued order for unit

Status
Not open for further replies.
Level 11
Joined
May 26, 2009
Messages
760
Greetings,

I want a trigger that triggers when I order a unit to move to (right-click) a unit owned by player 12 (brown). I want nothing to happen if only the ground is clicked.

  • RightClick
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Owner of (Target unit of issued order)) Equal to Player 12 (Brown)
    • Actions
      • Set Index = (Player number of (Owner of (Ordered unit)))
      • Unit - Order Rifleman[Index] to Stop
      • Unit - Make Rifleman[Index] face Loc over 0.00 seconds
      • Animation - Play Rifleman[Index]'s attack animation
      • Set Loc = (Position of (Target unit of issued order))
      • Special Effect - Create a special effect at Loc using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: call RemoveLocation(udg_Loc)
My trigger won't stop the unit, the unit will move to the right-clicked unit no matter what. I have tried to Stop a specific pre-chosen unit already placed on the map but that doesn't work either.
 
Level 4
Joined
Oct 19, 2010
Messages
71
I use something similar in my map. Order the unit to right click its current position. That should cancel any orders it was given. Like this:

  • Farm Animal Follow
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Ordered unit)) Equal to Sheep
          • (Unit-type of (Ordered unit)) Equal to Chicken
          • (Unit-type of (Ordered unit)) Equal to Pig
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(patrol))
    • Actions
      • Trigger - Turn off (This trigger)
      • Set tempPoint[1] = (Position of (Ordered unit))
      • Unit - Order (Ordered unit) to Right-Click tempPoint[1]
      • Custom script: call RemoveLocation(udg_tempPoint[1])
      • Trigger - Turn on (This trigger)
 
Status
Not open for further replies.
Top