• 🏆 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 not working properly

Status
Not open for further replies.
Level 11
Joined
May 7, 2008
Messages
321
Everything besides kill count works fine, and I don't know what's the problem :(

Like whenever I kill something as a player it works, but the numbers get mixed up for reasons unknown to me. For example, I get 1 kill as a red player, it works, but as soon as orange (computer 6) gets the kill, numbers start to mix up for no reason...


  • [/B] Create Multiboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Player_Count = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)).))
      • Multiboard - Create a multiboard with 3 columns and (1 + Player_Count) rows, titled Kill Count.
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Player Name
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Kills
      • For each (Integer A) from 1 to (1 + Player_Count), do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 2.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 12.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 2.00% of the total screen width
      • Set VariableSet List = 2
      • Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Multiboard_Spots[(Player number of (Picked player))] = List
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
          • Set VariableSet List = (List + 1)
      • Multiboard - Show (Last created multiboard)[B][trigger][/B]
  • [B][trigger][/B] Player Kills Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Killing unit)) controller) Equal to User
    • Actions
      • Set VariableSet Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Kill_Count[(Player number of (Owner of (Killing unit)))]))[B][trigger][/B]
  • [B][trigger][/B] Player leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 7 (Green) leaves the game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player).) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Multiboard - Set the text for (Last created multiboard) item in column 0, row Multiboard_Spots[(Player number of (Triggering player))] to Gone[B][trigger][/B]
  • [B][trigger][/B] Define Colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Player_Colors[1] = |c00ff0000
      • Set VariableSet Player_Colors[2] = |c000000ff
      • Set VariableSet Player_Colors[3] = |c0000ffff
      • Set VariableSet Player_Colors[4] = |c00800080
      • Set VariableSet Player_Colors[5] = |c00ffff00
      • Set VariableSet Player_Colors[7] = |c0000ff00
 

Attachments

  • 1.png
    1.png
    14 KB · Views: 14
  • 2.png
    2.png
    18.6 KB · Views: 13
  • 3.png
    3.png
    17.1 KB · Views: 14
  • 4.png
    4.png
    14.9 KB · Views: 16
  • 5.png
    5.png
    18.5 KB · Views: 15
  • 6.png
    6.png
    18.7 KB · Views: 14
  • 7.png
    7.png
    93.5 KB · Views: 16
  • 8.png
    8.png
    35.6 KB · Views: 13
  • 9.png
    9.png
    41 KB · Views: 15
  • 10.png
    10.png
    35.7 KB · Views: 14
Last edited by a moderator:
Level 23
Joined
Apr 3, 2018
Messages
460
Can you show a screenshot of your multiboard in game?
What I believe is the problem:
  • Player 6 orange slot state is not "playing" but "empty" (and controller is "user" by default for empty slots).
  • The on-kill trigger only checks if the killer is "user"-controlled, but does not check if the killer's slot is filled.
  • When that empty "player" kills, its "multiboard_spots" value is 0, so the kill count for that player is shown in every row.
You can add a condition to the on-kill trigger to check that the killing player slot is "playing", in addition to them being user-controlled. Then orange's kills will be ignored.
 
Last edited:
Level 11
Joined
May 7, 2008
Messages
321
Can you show a screenshot of your multiboard in game?
What I believe is the problem:
  • Player 6 orange slot state is not "playing" but "empty" (and controller is "user" by default for empty slots).
  • The on-kill trigger only checks if the killer is "user"-controlled, but does not check if the killer's slot is filled.
  • When that empty "player" kills, its "multiboard_spots" value is 0, so the kill count for that player is shown in every row.
You can add a condition to the on-kill trigger to check that the killing player slot is "playing", in addition to them being user-controlled. Then orange's kills will be ignored.


The number on ''Player Name'' shouldn't exist and whenever orange gets a kill it starts deducting it into my score. After I get the kill, my kill score shows up for a brief moment then once again after orange kills something his score gets up over mine.

EDIT: I added the function which you've advised to do and now it works great, problem solved!

Thanks for the help dude, I appreciate it :)

The command is:

((Owner of (Killing unit)) slot status) Equal to Is playing
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    59.5 KB · Views: 8
Last edited by a moderator:
Status
Not open for further replies.
Top