• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Disable friendly fire

Status
Not open for further replies.
In my map the heroes can attack their allies even if I set the targets allowed to debris,enemies,ground,item,structure. Now, this is strange. Any idea how to fix it?

I also have these

  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Hero - Make Player[(Integer A)] Heroes gain 30.00% experience from future kills
      • Player - Make Player[(Integer A)] treat Player 7 (Green) as an Ally
      • Player - Make Player[(Integer A)] treat Neutral Hostile as an Neutral
      • Player - Make Player 6 (Orange) treat Neutral Hostile as an Neutral
      • Player - Set name of Player[(Integer A)] to (Name of Player[(Integer A)])
      • Player - Make Player 7 (Green) treat Player[(Integer A)] as an Ally
Edit: I also have a question, how to edit the distance aggroes unfriendly unit chase you? When I aggro some unit they chace my hero for long...
 
Last edited:

Deleted member 242951

D

Deleted member 242951

  • Events -
  • Unit - A unit is issued an order targeting a unit
  • Conditions -
  • (Target unit of order being issued) belongs to an ally of (Owner of (triggering unit)) equal to true.
  • Actions -
  • Unit - Order (triggering unit) to stop
This always works. :)
(the condition is a boolean comparison that checks whether the unit belongs to an ally or enemy)
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
  • Events -
  • Unit - A unit is issued an order targeting a unit
  • Conditions -
  • (Target unit of order being issued) belongs to an ally of (Owner of (triggering unit)) equal to true.
  • Actions -
  • Unit - Order (triggering unit) to stop

I'm afraid this might also interrupt the order to simply move to an allied unit if I click on it. That's an undesired behavior of course. Use "A unit Is attacked" instead. The condition will be "(Attacked unit) belongs to an ally of (Owner of (Attacking unit)) Equal to True" and the action "Order (Attacking unit) to stop".


For your second question, go to Gameplay Constants ---> Tick "Use Custom Gameplay Constants" ---> Creeps - Guard Return Distance + Creeps - Guard Distance + Creeps - Guard Return Time (sec)

Try modifying them to low values and it should work.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Will this do?

  • Deny
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacked unit)) Less than or equal to 50.00
        • Then - Actions
          • Unit - Order (Attacking unit) to Attack (Attacked unit)
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
 
Level 25
Joined
May 11, 2007
Messages
4,651
Just a small question about your trigger stan,
why are you doing this?
"Player - Set name of Player[(Integer A)] to (Name of Player[(Integer A)])"

You're setting the Name of Player[A] to the name of Player[A].
 
Status
Not open for further replies.
Top