• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Preventing Friendly Fire

Status
Not open for further replies.
Level 2
Joined
Jul 28, 2011
Messages
8
Heya people, making a map in which I have triggers that are activated when units are killed. I need to make it so that allies can't kill eachother's units and exploit the triggers I've made.

I've seen it on a few maps where when you manually press 'a' and click on an ally's unit it won't allow you to attack it. Anyone know how it's done?
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
There are 2 ways...

1. Go through all effects and weapons that deal damage and make them exclude friendly units as a valid target.
2. Use a trigger that detects when a unit tries to attack a friendly unit and then orders the units to stop the attack order. You would still need to do 1 for all the effects.
 
Level 25
Joined
May 11, 2007
Messages
4,648
A unit is attacked by an unit
condition: player(owner of attacking unit) equal to player(owner of attacked unit)
action
unit issue order - order attacking unit to stop.

Sorry for the bad layout, but you get the idea.
 
Status
Not open for further replies.
Top