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

Help, units not getting added to unit groups

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
Ok so earlier I made a real stupid thread because I didn't get what was going on (I still don't know why it isn't working)

Now I think I found what's wrong, problem being I don't understand why it doesn't work.

  • Unit Group - Pick every unit in CP_UnitGroup_InZone[Temp_Int[0]] and do (Actions)
    • Loop - Actions
      • Set Temp_Unit[0] = (Picked unit)
      • Set Temp_Player[0] = (Owner of Temp_Unit[0])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Player[0] is in PlayerGroup_Team[1]) Equal to True
        • Then - Actions
          • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player[0] is in PlayerGroup_Team[2]) Equal to True
            • Then - Actions
              • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[2]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Player[0] is in PlayerGroup_Team[3]) Equal to True
                • Then - Actions
                  • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[3]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Temp_Player[0] is in PlayerGroup_Team[4]) Equal to True
                    • Then - Actions
                      • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[4]
                    • Else - Actions
For some reason it only works for team 1.

So people know nothing funny is going on elsewhere
  • Unit Group - Pick every unit in CP_UnitGroup_InZone[Temp_Int[0]] and do (Actions)
    • Loop - Actions
      • Set Temp_Unit[0] = (Picked unit)
      • Set Temp_Player[0] = (Owner of Temp_Unit[0])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Player[0] is in PlayerGroup_Team[1]) Equal to True
        • Then - Actions
          • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player[0] is in PlayerGroup_Team[2]) Equal to True
            • Then - Actions
              • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[2]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Player[0] is in PlayerGroup_Team[3]) Equal to True
                • Then - Actions
                  • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[3]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Temp_Player[0] is in PlayerGroup_Team[4]) Equal to True
                    • Then - Actions
                      • Unit Group - Add Temp_Unit[0] to CP_UnitGroup_InTeam[4]
                    • Else - Actions
  • Set Temp_Int[1] = (Number of units in CP_UnitGroup_InTeam[1])
  • Set Temp_Int[2] = (Number of units in CP_UnitGroup_InTeam[2])
  • Set Temp_Int[3] = (Number of units in CP_UnitGroup_InTeam[3])
  • ETC...
  • Game - Display to (All players) the text: (String(Temp_Int[1]))
is the only one that displays a number other than 0
 
Level 12
Joined
Nov 3, 2013
Messages
989
I just took one of the integers I already had, besides that I've got to add an index every time (gets a bit annoying) does it matter?

Edit: I guess it drains more of the pc since it's an array, now that it's already made is it something I should take the time and change?

Edit2: Also it saved me a couple of seconds of time when I made:
  • Set Temp_Int[6] = (Temp_Int[0] + CP_Init_Int_ZonesAmount)
  • Set Temp_Int[7] = (Temp_Int[0] + (CP_Init_Int_ZonesAmount x 2))
  • Set Temp_Int[8] = (Temp_Int[0] + (CP_Init_Int_ZonesAmount x 3))
  • ETC...
Edit3: I would have put another nestled array for the above but then I only had 4 so I didn't bother...
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
CP_UnitGroup_InTeam
CP_UnitGroup_InZone
PlayerGroup_Team

From variable editor, set these variables' size to something like 17.
 
Status
Not open for further replies.
Top