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

Multiboard Active Players

Status
Not open for further replies.
Level 19
Joined
Oct 7, 2014
Messages
2,209
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,651
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,209
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