• 🏆 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] Unit Group Count to Int Issue

Status
Not open for further replies.
Level 10
Joined
May 20, 2008
Messages
433
Apparently there is something wrong when the variables "CapturePoint_Human/Alien" are set. While one should be set to 2 (because there are 2 'circle of power (medium)' owned by gray on the map), it gets set to 0. It worked until I added the unit group stuff. What went wrong?
  • Income
    • Events
      • Game - The in-game time of day becomes Equal to 0.00
      • Game - The in-game time of day becomes Equal to 12.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (Picked unit)) Equal to Player 9 (Gray)) and ((Unit-type of (Picked unit)) Equal to Circle of Power (medium)))) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Income_UnitGroup
      • Set CapturePoints_Human = (Number of units in Income_UnitGroup)
      • Unit Group - Remove all units from Income_UnitGroup
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (Picked unit)) Equal to Player 10 (Light Blue)) and ((Unit-type of (Picked unit)) Equal to Circle of Power (medium)))) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Income_UnitGroup
      • Set CapturePoints_Alien = (Number of units in Income_UnitGroup)
      • Unit Group - Remove all units from Income_UnitGroup
      • Set Income[0] = (CapturePoints_Human x 84)
      • Set Income[1] = (CapturePoints_Alien x 86)
      • Game - Display to (All players) for 15.00 seconds the text: />: Income Recieved
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
              • (Integer A) Less than or equal to 4
            • Then - Actions
              • -------- Humans --------
              • Player - Add Income[0] to (Player((Integer A))) Current gold
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player((Integer A))) slot status) Equal to Is playing
                  • (Integer A) Greater than or equal to 5
                • Then - Actions
                  • -------- Aliens --------
                  • Player - Add Income[1] to (Player((Integer A))) Current lumber
                • Else - Actions
PS: Those who are going to complain about the leaks, I'll fix them after this is fixed.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Change the picked units to matching units :)

  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (MATCHING unit)) Equal to Player 9 (Gray)) and ((Unit-type of (MATCHING unit)) Equal to Circle of Power (medium)))) and do (Actions)
 
Level 10
Joined
May 20, 2008
Messages
433
Change the picked units to matching units :)

  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (MATCHING unit)) Equal to Player 9 (Gray)) and ((Unit-type of (MATCHING unit)) Equal to Circle of Power (medium)))) and do (Actions)

It works fine, thanks (though I still find it odd how I forgot that existed :\). Rep'd
 
Status
Not open for further replies.
Top