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

Friendly Fire Problems

Status
Not open for further replies.
Level 4
Joined
Aug 2, 2007
Messages
69
My first problem is that I cannot figure out how to make it so that if someone tries to attack an ally player, that they do not attack them, so there are no allies attacking alliles.

My second problem is that the fountain of health can heal enemies when around it, how do I make it so that it does not heal enemies?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Sorry I don't have WE (I'm on vacation) so I'll have to explain it to you in text.
First question: Make an event 'Unit - Generic unit: Is Attacked'
A condition: Boolean Comparison( Player (Get Player Owning Unit(Get Attacking Unit) is an ally of player (Get Player Owning unit(Get Attacked Unit)) = true)
An Action: Unit - Order unit with no target ("stop")

That leaks a force (I think) but its not a super leak, so you should be fine.

Second question: Look at what ability the 'Fountain of Life' has (that you think is responsible for the healing) and modify that ability to only affect allies. (Under Targets only enable Allies, Ground, Air, Vulnerable, Invulnerable)
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
Trigger that work (i think :S)
  • Events
  • A Unit is attacked
  • Conditions
  • Player - (Owner of Attacked unit) is an ally of (Owner of attacking unit) Equal to true
  • Actions:
  • Unit - Issue Order (attacking Unit) to Stop
  • Unit - Make attacked unit Invlnerable
  • Wait 0.05 Seconds
  • Unit - Make (attacked Unit) Vulnerable
Another trigger could be:
  • Events
  • A Unit is issued Order Targeting a Unit
  • Conditions
  • Player - (Owner of Target unit issued Order) is an ally of (Owner of Unit Isuued Order) Equal to true
  • Actions:
  • Unit - Issue Order (Unit Issued Order) to Stop
Hope this would help you :)
PS: Sorry for the crappy triggers - im not that good im making triggers on THW ^^
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
well you say wait 0.05 but since wait 0.05 does same thing with 0.5 xD
(wait is weird) if someone else gets attacked that invulnurability will stay on him I guess OR you can use this way to keep someone invulnurable

-End of Annoying Post-
 
Status
Not open for further replies.
Top