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

[Trigger] Friendly Fire Prevention Help

Status
Not open for further replies.
Level 4
Joined
May 6, 2007
Messages
87
Hey guys... I'm trying to create something that stops a player from attacking an allied player, but it isn't working.

Player 1, 2, and 3 are all human players.
Player 4 is a computer.

  • Friendly Fire
    • Events
      • Unit - A Unit is issued an order targeting an object
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Issued Order) Equal to (Order(attack))
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Target unit of issued order)) Equal to Player 1 (Red)
              • (Owner of (Target unit of issued order)) Equal to Player 2 (Blue)
              • (Owner of (Target unit of issued order)) Equal to Player 3 (Teal)
              • (Owner of (Target unit of issued order)) Equal to Player 4 (Purple)
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Ordered unit)) Equal to Player 1 (Red)
              • (Owner of (Ordered unit)) Equal to Player 2 (Blue)
              • (Owner of (Ordered unit)) Equal to Player 3 (Teal)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Target unit of issued order)) Equal to Player 4 (Purple)
              • (Percentage life of (Target unit of issued order)) Less than or equal to 15.00
        • Then - Actions
          • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Owner of (Target unit of issued order)) Equal to Player 4 (Purple)
                  • (Percentage life of (Target unit of issued order)) Greater than 15.00
          • Then - Actions
            • Unit - Order (Ordered unit) to Stop
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Owner of (Target unit of issued order)) Equal to Player 1 (Red)
                    • (Owner of (Target unit of issued order)) Equal to Player 2 (Blue)
                    • (Owner of (Target unit of issued order)) Equal to Player 3 (Teal)
            • Then - Actions
              • Unit - Order (Ordered unit) to Stop
            • Else - Actions
              • Do nothing
I can't tell why it isn't working. When I have a unit attack player 4, it doesn't do anything at all. The unit doesn't stop... it just keeps attacking.

Any ideas?

Thanks in advance.
 
Level 4
Joined
May 6, 2007
Messages
87
Wow, that's a lot easier... is it possible to add in a feature that will allow a player to kill Player 4's creeps if they have less than or equal to 15% life, but make the player stop if Player 4's creeps have more than 15% life?
 
Level 4
Joined
Aug 31, 2007
Messages
54
  • 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
          • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Triggering unit)) Less than or equal to 15.00
            • Then - Actions
            • Else - Actions
              • Unit - Order (Attacking unit) to Stop
        • Else - Actions
EDIT
god damit i really should put all my attention to posting
 
Level 4
Joined
May 6, 2007
Messages
87
  • Events
  • Unit - A unit is attacked
  • Conditions
  • Boolean Comparison - Owner of Triggering Unit is an ally to Owner of Attacking Unit equal to true
  • Real Comparison - Percent Life of Triggering unit is Greater than or equal to 15.00
  • Actions
  • Unit - Order Attacking Unit to Stop
--donut3.5--

Is there any way to set it up so that the Real Comparison (the greater than 15% life thing) applies only to player four? I don't want the heroes to be able to attack each other at all (Players 1-3), and they can't attack Player 4 unless Player 4's creeps have less than or equal to 15% life.:eekani:
 
Level 4
Joined
May 6, 2007
Messages
87
Well, there are three teams.

Team one has Player 4 as their town (computer), and players one through three as their heroes.

Team Two has Player 8 as their town (computer), and players five through seven as their heroes.

Team Three has Player 12 as their town (computer), and players nine through eleven as their heroes.

I don't want players to ever be able to attack their allies, except for when their respective town's creeps (Player 4, 8, and 12 respectively) have less than 15% life. They can attack the other teams though.

I suppose I'm looking for something similar to DotA's denying system, just three-way.

Sorry if I was unclear earlier, and thanks for all the help you've already given me. :thumbs_up:
 
Status
Not open for further replies.
Top