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

Detecting Patrol?

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2009
Messages
397
I'm trying to disable patrol in my map, I've tried a few different things, but the one i like best is this trigger, but it's not working 100% of the time. Is there something that can be added to make it work all the time?

  • Disable Patrol
    • 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
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (==) (Order(patrol))
        • Then - Actions
          • Unit - Add classification of A peon-type unit to (Ordered unit)
        • Else - Actions
          • Unit - Remove classification of A peon-type unit from (Ordered unit)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 055
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(patrol))
    • Actions
      • Set Temp_Loc_1 = (Target point of issued order)
      • Unit - Order (Triggering unit) to Attack-Move To Temp_Loc_1
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
With this the unit is ordered to attack-move to the point it is ordered to patrol, it won't start to patrol.
 
Level 8
Joined
Dec 9, 2009
Messages
397
Is Attack-Move a correct command? It's not working.

But the method I was using.. if I could get it to work every time, Stopped them from attacking if they were using patrol to follow behind someone.
 
Level 8
Joined
Dec 9, 2009
Messages
397
If you right click on a unit, your unit follows the other, and assists in battle.
I don't want the following unit to assist in battle.

  • DisablePatrol2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Set TempLoc = (Target point of issued order)
      • Unit - Order (Ordered unit) to (Order(attack-move)) TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
Hm, or is Ordered unit my problem?
The Unit was still able to patrol from point to point.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
If you right click on a unit, your unit follows the other, and assists in battle.
I don't want the following unit to assist in battle.

Wut? You want the ordered unit to assist in battle but not assist in battle? Unfortnuately my abilities are too limited to create such a trigger...

State clearly what you're trying to do.

Unit A is ordered to right click on unit B.
Unit A then follows unit B and unit A then assists unit B in battle.
Then what? How does patrol play a part in this act?
 
Level 8
Joined
Dec 9, 2009
Messages
397
Patrol is the button that is pressed down on the unit command area when following via right click.

I do NOT want the following unit to assist in battle.

I would like to disable both types of patrol, point to point, and following via patrol.

When I spoke of Ordered unit, I was talking about in my trigger i put ordered unit, you put triggering unit.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Ah, now I get it. You're talking about the 'smart' order.

  • Untitled Trigger 055
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(patrol))
          • (Issued order) Equal to (Order(smart))
    • Actions
      • Set Temp_Unit_1 = (Target unit of issued order)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Unit_1 Not equal to No unit
        • Then - Actions
          • Set Temp_Loc_1 = (Position of Temp_Unit_1)
        • Else - Actions
          • Set Temp_Loc_1 = (Target point of issued order)
      • Unit - Order (Triggering unit) to Attack-Move To Temp_Loc_1
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Set Temp_Unit_1 = No unit
You can order the unit to stop also.
 
Level 8
Joined
Dec 9, 2009
Messages
397
I'm trying to also stop someone from using patrol to follow other people.

I was able to stop the unit if it tries to patrol to point but I can't seem to get anything to trigger if the target is a unit.

I just tried to make it if it's either patrol, or smart just stop the unit to make everything easy.

EDIT: Here is the trigger, It should stop the unit if it tries to right click to follow another unit, and give a message to the owner of the unit saying that Move may be used to follow.

  • Disable Patrol
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (==) (Order(patrol))
          • (Issued order) Equal to (==) (Order(smart))
    • Actions
      • Set TempUnit = (Target unit of issued order)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempUnit Equal to (==) No unit
          • Then - Actions
            • Unit - Order (Triggering unit) to stop
          • Else - Actions
            • Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: You may use "move" ...
            • Unit - Order (Triggering unit) to stop
      • Set TempUnit = No unit
 
Last edited:
The correct command is not "Attack-Move". If a unit is ordered to "attack" a point, it will attack-move to that point.

To stop a unit's current order, the best method is to simply instantly move the unit to its current position - the unit won't be seen to move, but that will cancel its orders.

EDIT: Even better, when the unit is issued a smart order on another unit, you could simply re-order it to "move" instead of "patrol".
 
Status
Not open for further replies.
Top