Disable Auto-Attack

Status
Not open for further replies.
Level 12
Joined
Jul 27, 2008
Messages
1,181
Must the unit be seen? If not, modify permanent invisibility (set auto-aqcuire to false)
Does the unit have to attack anyone? If not, create a trigger that stops it when it starts attacking.

EDIT: Worker will also cause it to flee, and "Acquisition Range to 5" will set its attack range to 5.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
  • stop auto attacking
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • (Target unit of issued order) Equal to (Your Unit)
    • Actions
      • Set POINT_1 = (Position of (Target unit of issued order))
      • Set POINT_2 = (Position of (Ordered unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between POINT_1 and POINT_2) Greater than 500.00
        • Then - Actions
          • Unit - Order (Target unit of issued order) to Stop
        • Else - Actions
      • Custom script: call RemoveLocation(udg_POINT_1)
      • Custom script: call RemoveLocation(udg_POINT_2)
wait 0 sec or it will not work (unit cannot have 2 orders at the same time)

you can also order (ordered unit) to attack nearby enemy or something......

you can always stop (ordered unit) if you want

this is just making him not auto-attack if ordered (attacking unit) unit is to far


unit stops every time when he is attacked and it will be the problem if player wants to move the unit, but you could add condition (target is selected by owner of target not equal to true)
 
Status
Not open for further replies.
Top