• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[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