• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Multiboard Active Players

Status
Not open for further replies.
Level 19
Joined
Oct 7, 2014
Messages
2,208
Hello Hive :)
I have a problem I can't removed the player who is not playing in the multiboard I made. I already have a Defeat Player Array which checks if a player is active or not.
I really hope someone could help me.

Here is the triggers:

  • Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and 13 rows, titled Information
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Change the color of the title for Multiboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the icon for Multiboard item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNHumanCaptureFlag.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNTownHall.blp
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to Factions
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to Towns
      • Multiboard - Set the width for Multiboard item in column 0, row 0 to 12.00% of the total screen width
      • Multiboard - Show Multiboard
  • Count Captured City
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Multiboard_Player[(Player number of (Picked player))] = (All players matching (Defeat_Player[(Player number of (Picked player))] Equal to False))
          • Set Multiboard_Int = (Number of players in Multiboard_Player[(Player number of (Picked player))])
          • For each (Integer Multiboard_Int) from 1 to 12, do (Actions)
            • Loop - Actions
              • Multiboard - Set the text for Multiboard item in column 1, row (Multiboard_Int + 1) to (Name of (Player(Multiboard_Int)))
              • Multiboard - Set the text for Multiboard item in column 2, row (Multiboard_Int + 1) to (String(Cities_Per_Player[Multiboard_Int]))
              • Multiboard - Set the display style for Multiboard item in column 1, row (Multiboard_Int + 1) to Show text and Hide icons
              • Multiboard - Set the display style for Multiboard item in column 2, row (Multiboard_Int + 1) to Show text and Hide icons
 
Level 25
Joined
May 11, 2007
Messages
4,648
Don't use a loop, instead have a trigger that is triggered when a player is defeated that runs the Count Captured City.

It's just redudant to have a trigger setting the multiboard every second when it needs to run at max 11 times.
 
Level 19
Joined
Oct 7, 2014
Messages
2,208
I tried revising the trigger and I made it like this and it worked.

  • Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and 13 rows, titled Information
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Change the color of the title for Multiboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the icon for Multiboard item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNHumanCaptureFlag.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNTownHall.blp
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to Factions
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to Towns
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Multiboard item in column 0, row (Integer A) to 12.00% of the total screen width
          • Multiboard - Set the width for Multiboard item in column 1, row (Integer A) to 11.00% of the total screen width
          • Multiboard - Set the width for Multiboard item in column 2, row (Integer A) to 5.00% of the total screen width
          • Multiboard - Set the width for Multiboard item in column 3, row (Integer A) to 6.00% of the total screen width
          • Multiboard - Set the display style for Multiboard item in column 1, row ((Integer A) + 1) to Show text and Hide icons
          • Multiboard - Set the display style for Multiboard item in column 2, row ((Integer A) + 1) to Show text and Hide icons
      • Set Multiboard_PlayerGroup = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Player Group - Pick every player in Multiboard_PlayerGroup and do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for Multiboard item in column 1, row ((Player number of (Picked player)) + 1) to (Name of (Picked player))
      • Custom script: call DestroyForce(udg_Multiboard_PlayerGroup)
      • Multiboard - Show Multiboard
and I move this trigger into this trigger

  • Capture City
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is in City_Group) Equal to True
      • (Life of (Attacked unit)) Less than or equal to 500.00
    • Actions
      • Set Cities_Per_Player[(Player number of (Owner of (Attacked unit)))] = (Cities_Per_Player[(Player number of (Owner of (Attacked unit)))] - 1)
      • Set Cities_Per_Player[(Player number of (Owner of (Attacking unit)))] = (Cities_Per_Player[(Player number of (Owner of (Attacking unit)))] + 1)
      • Multiboard - Set the text for Multiboard item in column 2, row ((Player number of (Owner of (Attacked unit))) + 1) to (String(Cities_Per_Player[(Player number of (Owner of (Attacked unit)))]))
      • Multiboard - Set the text for Multiboard item in column 2, row ((Player number of (Owner of (Attacking unit))) + 1) to (String(Cities_Per_Player[(Player number of (Owner of (Attacking unit)))]))
      • Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
      • Unit - Set life of (Attacked unit) to 100.00%
 
Status
Not open for further replies.
Top