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

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.
 
Level 3
Joined
Mar 30, 2011
Messages
36
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
 
Level 9
Joined
Dec 26, 2010
Messages
475
  • 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
 
Level 3
Joined
Mar 30, 2011
Messages
36
  • 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
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
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.
Top