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

How to fix units not attacking when ordered to

Status
Not open for further replies.
Level 2
Joined
Jan 29, 2023
Messages
10
1709158313981.png

Soo when i try to use the comand "pick every unit in unit group and do action" (to avoid the 12 unit cap from the other i one) my units get stuck and i cant do anything about it i tried messing with the ai but nothing seems to work
edit: the picture just shows how roughly how much units i plan on attacking eachother
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
You have to split them up between multiple Players. You should also try reducing their collision size, apparently that helps.

I find that ~60 units per Player seems to do the trick. So you could have 720 units per team, Team 1 = Players 1 to 12, and Team 2 = Players 13 to 24. Give each of these Players the same color / name using triggers so that they all appear the same. Of course this is assuming that you don't actually need to manually control all of these units.
 
Last edited:
Level 2
Joined
Jan 29, 2023
Messages
10
You have to split them up between multiple Players. You should also try reducing their collision size, apparently that helps.

I find that ~60 units per Player seems to do the trick. So you could have 720 units per team, Team 1 = Players 1 to 12, and Team 2 = Players 13 to 24. Give each of these Players the same color / name using triggers so that they all seem the same. Of course this is assuming that you don't actually need to manually control all of these units.
collision size worked for the most part and i will use it for now , dividing the units between players seems complicated for me now but thanks regardless
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
collision size worked for the most part and i will use it for now , dividing the units between players seems complicated for me now but thanks regardless
That's good.

Here's how you can divide the units and setup the players. Nothing too complicated:
  • Setup Players and Units
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Change Player colors and names: --------
      • Player - Change color of Player 13 (Maroon) to Blue, Changing color of existing units
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Picked player)) Less than 13
            • Then - Actions
              • Player - Change color of (Picked player) to Red, Changing color of existing units
              • Player - Set name of (Picked player) to (Name of Player 1 (Red))
            • Else - Actions
              • Player - Change color of (Picked player) to Blue, Changing color of existing units
              • Player - Set name of (Picked player) to (Name of Player 13 (Maroon))
      • -------- --------
      • -------- Divide all units owned by Player 1 between Players 1 and 12: --------
      • Set VariableSet Player_Number = 1
      • Set VariableSet New_Player = (Player(Player_Number))
      • Set VariableSet Unit_Count = 0
      • Unit Group - Pick every unit in (Units owned by New_Player.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit_Count = (Unit_Count + 1)
          • Unit - Change ownership of (Picked unit) to New_Player and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit_Count Equal to 60
            • Then - Actions
              • Set VariableSet Unit_Count = 0
              • Set VariableSet Player_Number = (Player_Number + 1)
              • Set VariableSet New_Player = (Player(Player_Number))
            • Else - Actions
      • -------- --------
      • -------- Divide all units owned by Player 13 between Players 13 and 24: --------
      • Set VariableSet Player_Number = 13
      • Set VariableSet New_Player = (Player(Player_Number))
      • Set VariableSet Unit_Count = 0
      • Unit Group - Pick every unit in (Units owned by New_Player.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit_Count = (Unit_Count + 1)
          • Unit - Change ownership of (Picked unit) to (Player(Player_Number)) and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit_Count Equal to 60
            • Then - Actions
              • Set VariableSet Unit_Count = 0
              • Set VariableSet Player_Number = (Player_Number + 1)
              • Set VariableSet New_Player = (Player(Player_Number))
            • Else - Actions
So your units owned by Player 2 would need to be switched to Player 13 and you'd need to adjust the Player Properties to have two Teams (12vs12). Then this trigger will automatically recolor all of the units to be Red/Blue depending on their Team and split them up amongst their allies. It gives the illusion that they're all owned by Red and Blue but in reality the units are divided evenly among all 24 Player slots.

The map requires the latest patch to open.
 

Attachments

  • Setup Players and Units.w3m
    36.7 KB · Views: 3
Last edited:
Level 2
Joined
Jan 29, 2023
Messages
10
That's good.

Here's how you can divide the units and setup the players. Nothing too complicated:
  • Setup Players and Units
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Change Player colors and names: --------
      • Player - Change color of Player 13 (Maroon) to Blue, Changing color of existing units
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Picked player)) Less than 13
            • Then - Actions
              • Player - Change color of (Picked player) to Red, Changing color of existing units
              • Player - Set name of (Picked player) to (Name of Player 1 (Red))
            • Else - Actions
              • Player - Change color of (Picked player) to Blue, Changing color of existing units
              • Player - Set name of (Picked player) to (Name of Player 13 (Maroon))
      • -------- --------
      • -------- Divide all units owned by Player 1 between Players 1 and 12: --------
      • Set VariableSet Player_Number = 1
      • Set VariableSet New_Player = (Player(Player_Number))
      • Set VariableSet Unit_Count = 0
      • Unit Group - Pick every unit in (Units owned by New_Player.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit_Count = (Unit_Count + 1)
          • Unit - Change ownership of (Picked unit) to New_Player and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit_Count Equal to 60
            • Then - Actions
              • Set VariableSet Unit_Count = 0
              • Set VariableSet Player_Number = (Player_Number + 1)
              • Set VariableSet New_Player = (Player(Player_Number))
            • Else - Actions
      • -------- --------
      • -------- Divide all units owned by Player 13 between Players 13 and 24: --------
      • Set VariableSet Player_Number = 13
      • Set VariableSet New_Player = (Player(Player_Number))
      • Set VariableSet Unit_Count = 0
      • Unit Group - Pick every unit in (Units owned by New_Player.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Unit_Count = (Unit_Count + 1)
          • Unit - Change ownership of (Picked unit) to (Player(Player_Number)) and Change color
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit_Count Equal to 60
            • Then - Actions
              • Set VariableSet Unit_Count = 0
              • Set VariableSet Player_Number = (Player_Number + 1)
              • Set VariableSet New_Player = (Player(Player_Number))
            • Else - Actions
So your units owned by Player 2 would need to be switched to Player 13 and you'd need to adjust the Player Properties to have two Teams (12vs12). Then this trigger will automatically recolor all of the units to be Red/Blue depending on their Team and split them up amongst their allies. It gives the illusion that they're all owned by Red and Blue but in reality the units are divided evenly among all 24 Player slots.

The map requires the latest patch to open.
i tried it and it works although i lowered the amount of units per player as 60 was a lot(lowered it to 30 since that works for me) thanks a lot bro
 
Status
Not open for further replies.
Top