Help getting anti ally kill working!

Status
Not open for further replies.
That's pretty easy :)
Just create a trigger, add all possible events to it involving Players
ordering there units to do stuff related to combat, add an if/then/else
action that checks if the attacked unit is allied. If no, it won't do anything.
If yes, then it will check if the targetted unit is owned by the triggering player.
If yes, then it won't do anything, else, it will order the triggering unit to stop immediately.
 
That's pretty easy :)
Just create a trigger, add all possible events to it involving Players
ordering there units to do stuff related to combat, add an if/then/else
action that checks if the attacked unit is allied. If no, it won't do anything.
If yes, then it will check if the targetted unit is owned by the triggering player.
If yes, then it won't do anything, else, it will order the triggering unit to stop immediately.

Didn't get it :s
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Equal to (Owner of (Attacking unit))) and (((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True)
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Equal to (Owner of (Attacking unit))) and (((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True)
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions


Much better! Thanks again =D
 
Note that the above trigger requires the unit has atleast some backward swing on attacks.

The reason the more logical trigger of ordering the unit to stop on recieving an order to attack an ally does not work is that the order is issued after the event fires and it seems to result in queing orders up (it attacks and then stops once the unit dies).

Although the above could be optimized by using JASS, it is generally the best anti TK system for preventing attacking allies.
 
Status
Not open for further replies.
Back
Top