• 🏆 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!

[Trigger] Make Neutral Victim Attack

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
I have a 6x6 hero arena, I have two arenas, in one of them its impossible to enemy to enter in your base, but in the other arena they can, so I put a tower to disable ress kill, but If I give that tower to a player, they kill count, gold or whatever can bug.

So I make the towers owners be Neutral Victim and Neutral Extra.
But... Neutral victim don't attack...

  • Test
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Unit - Change ownership of Guard Tower 0359 <gen> to Neutral Victim and Retain color
      • Player Group - Make (Player group(Neutral Victim)) treat (All enemies of Player 1 (Red)) as an Enemy
      • Player Group - Make (Player group(Neutral Victim)) treat (All allies of Player 1 (Red)) as an Ally
      • Player Group - Make (All allies of Player 1 (Red)) treat (Player group(Neutral Victim)) as an Ally
 
Well, this is the best I can do. Hope it helps.
Note: If you use this, I recomend you make the tower invunarable because your units will have a nasty habbit of wanting to kill it.:grin:
  • Tower Attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempLocA = (Position of Tower[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True)))) Greater than 0
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order Tower[1] to Attack (Picked unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLocA)
      • Set TempLocA = (Position of Tower[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 7 (Green)) Equal to True) and (((Matching unit) is alive) Equal to True)))) Greater than 0
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 7 (Green)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order Tower[2] to Attack (Picked unit)
        • Else - Actions
 
This should fix it :grin:
  • Tower Attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempLocA = (Position of Tower[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Number of units in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True)))) Greater than 0
              • (Current order of Tower[1]) Equal to (Order(<Empty String>))
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order Tower[1] to Attack (Picked unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLocA)
      • Set TempLocA = (Position of Tower[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Number of units in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 7 (Green)) Equal to True) and (((Matching unit) is alive) Equal to True)))) Greater than 0
              • (Current order of Tower[2]) Equal to (Order(<Empty String>))
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 800.00 of TempLocA matching ((((Matching unit) belongs to an enemy of Player 7 (Green)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order Tower[2] to Attack (Picked unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLocA)
 
Level 12
Joined
Mar 23, 2008
Messages
942
I wanna know how the guys did to make neutral victim able to attack.

This thing of periodic event is a last resource.

Edit:

For some reason, this work:
  • Player - Make Neutral Victim treat Player 2 (Blue) as an Enemy
And this not:
  • Player Group - Make (Player group(Neutral Victim)) treat (All enemies of Player 1 (Red)) as an Enemy
 
  • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
    • Loop - Actions
      • Player - Make (Picked player) treat Neutral Victim as an Ally
      • Player - Make Neutral Victim treat (Picked player) as an Ally
  • Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)
    • Loop - Actions
      • Player - Make (Picked player) treat Neutral Victim as an Enemy
      • Player - Make Neutral Victim treat (Picked player) as an Enemy
 
Level 12
Joined
Mar 23, 2008
Messages
942
Strange that neutral extra accept this:

  • Player Group - Make (Player group(Neutral Victim)) treat (All enemies of Player 1 (Red)) as an Enemy
But neutral victim only accept individual alliance setting.
 
Status
Not open for further replies.
Top