[Solved] Problem with Multiboard - Killing Units

Level 8
Joined
Jun 26, 2019
Messages
317
Okay, I have problem with multiboard of killing units. I am trying to set the killing units to be only by players and only kills the ground units, no flying units or no buildings, or no towers. Just ground units only. Footmen, Knight, Siege, etc. Ground unit kills goes to multiboard called "Units Killed."

But, the problem is, when you killed the first ground unit, the multiboard don't show "1" yet, for until I killed a second ground unit, and it finally show "1" on multiboard, but it supposed to be "2." Killed 2 ground units and only show "1" on multiboard.

And, other problem is when I killed a tower or town hall, it does added 1 kill to multiboard. I don't want tower or building to be added to kills. Only ground units get kills from killing ground units. There's 6 ground units getting killed by Player 1's knights. The multiboard should show "6" kills. Not "5" at before destroying the town hall or "7" kills at after destroying the town hall.

I hope you know what I am trying to say. Here the map file and you can figure it out what's wrong with multiboard.
 

Attachments

  • Multiboard Test 1.w3x
    303.9 KB · Views: 19
Level 8
Joined
Jun 26, 2019
Messages
317
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 4 columns and 7 rows, titled |cffffffffScoreboar...
      • 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 UI\Minimap\MinimapIconCreepLoc2.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 6 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 7 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 1, row 8 to ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 2 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 3 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 4 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 5 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 6 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 7 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the icon for Multiboard item in column 2, row 8 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the width for Multiboard item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 1 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 1 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 1 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 1 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 2 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 2 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 2 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 2 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 3 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 3 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 3 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 3 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 4 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 4 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 4 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 4 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 5 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 5 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 5 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 5 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 6 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 6 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 6 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 6 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 6 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 7 to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 7 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 7 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 7 to 12.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 5, row 7 to 12.00% of the total screen width
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to Players
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to Gold
      • Multiboard - Set the text for Multiboard item in column 3, row 1 to Lumber
      • Multiboard - Set the text for Multiboard item in column 4, row 1 to Units Killed
      • Multiboard - Set the text for Multiboard item in column 5, row 1 to Structures Destroyed
      • Multiboard - Set the text for Multiboard item in column 1, row 2 to (Name of Player 1 (Red))
      • Multiboard - Set the text for Multiboard item in column 1, row 3 to (Name of Player 2 (Blue))
      • Multiboard - Set the text for Multiboard item in column 1, row 4 to (Name of Player 3 (Teal))
      • Multiboard - Set the text for Multiboard item in column 1, row 5 to (Name of Player 4 (Purple))
      • Multiboard - Set the text for Multiboard item in column 1, row 6 to (Name of Player 5 (Yellow))
      • Multiboard - Set the text for Multiboard item in column 1, row 7 to (Name of Player 6 (Orange))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to (|cffff0000 + ((Name of Player 1 (Red)) + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to (|cff0000ff + ((Name of Player 2 (Blue)) + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to (|cff00ffff + ((Name of Player 3 (Teal)) + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to (|cff6f2583 + ((Name of Player 4 (Purple)) + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 6 to (|cffffff00 + ((Name of Player 5 (Yellow)) + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 7 to (|cffd45e19 + ((Name of Player 6 (Orange)) + |r))
      • Multiboard - Set the text for Multiboard item in column 2, row 2 to (String((Player 1 (Red) Current gold)))
      • Multiboard - Set the text for Multiboard item in column 2, row 3 to (String((Player 2 (Blue) Current gold)))
      • Multiboard - Set the text for Multiboard item in column 2, row 4 to (String((Player 3 (Teal) Current gold)))
      • Multiboard - Set the text for Multiboard item in column 2, row 5 to (String((Player 4 (Purple) Current gold)))
      • Multiboard - Set the text for Multiboard item in column 2, row 6 to (String((Player 5 (Yellow) Current gold)))
      • Multiboard - Set the text for Multiboard item in column 2, row 7 to (String((Player 6 (Orange) Current gold)))
      • Multiboard - Set the icon for Multiboard item in column 3, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 2 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 3 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 4 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 5 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 6 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the icon for Multiboard item in column 3, row 7 to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the text for Multiboard item in column 3, row 2 to (String((Player 1 (Red) Current lumber)))
      • Multiboard - Set the text for Multiboard item in column 3, row 3 to (String((Player 2 (Blue) Current lumber)))
      • Multiboard - Set the text for Multiboard item in column 3, row 4 to (String((Player 3 (Teal) Current lumber)))
      • Multiboard - Set the text for Multiboard item in column 3, row 5 to (String((Player 4 (Purple) Current lumber)))
      • Multiboard - Set the text for Multiboard item in column 3, row 6 to (String((Player 5 (Yellow) Current lumber)))
      • Multiboard - Set the text for Multiboard item in column 3, row 7 to (String((Player 6 (Orange) Current lumber)))
      • Multiboard - Set the icon for Multiboard item in column 4, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 2 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 3 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 4 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 5 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 6 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the icon for Multiboard item in column 4, row 7 to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the text for Multiboard item in column 4, row 2 to (String(Kills[1]))
      • Multiboard - Set the text for Multiboard item in column 4, row 3 to (String(Kills[2]))
      • Multiboard - Set the text for Multiboard item in column 4, row 4 to (String(Kills[3]))
      • Multiboard - Set the text for Multiboard item in column 4, row 5 to (String(Kills[4]))
      • Multiboard - Set the text for Multiboard item in column 4, row 6 to (String(Kills[5]))
      • Multiboard - Set the text for Multiboard item in column 4, row 7 to (String(Kills[6]))
      • Multiboard - Show Multiboard
 
Level 8
Joined
Jun 26, 2019
Messages
317
  • Update Kills 1
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiboard - Set the text for Multiboard item in column 4, row 2 to (String(Kills[1]))
      • Multiboard - Set the text for Multiboard item in column 4, row 3 to (String(Kills[2]))
      • Multiboard - Set the text for Multiboard item in column 4, row 4 to (String(Kills[3]))
      • Multiboard - Set the text for Multiboard item in column 4, row 5 to (String(Kills[4]))
      • Multiboard - Set the text for Multiboard item in column 4, row 6 to (String(Kills[5]))
      • Multiboard - Set the text for Multiboard item in column 4, row 7 to (String(Kills[6]))
 
Level 8
Joined
Jun 26, 2019
Messages
317
  • Update Kills 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Attacked unit) is A ground unit) Equal to True
          • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set i = (Player number of (Owner of (Killing unit)))
      • Set Kills[i] = (Kills[i] + 1)
 
Level 8
Joined
May 21, 2019
Messages
435
Here's what I am seeing:
  • You are running a condition check for the unit to be a ground unit, but you aren't running a condition check for the unit not being a structure. There is no reason why a structure wouldn't count as a kill then.
  • Your 2 update kill triggers have the exact same event, which is poor synchronization design. I believe that the game runs whatever trigger is highest, but it may also go by the names, so that would mean that 1 is run before 2. Seeing how 2 is the one that actually updates the variable, and 1 is the one the updates the multiboard, you may actually be updating the multiboard before the variable updates, which would mean that you're 1 kill behind at all times. A much better option in your case is to simple copy all of the actions in update kills 1, and put them after the actions in your update 2 trigger, then delete the update 1 trigger, leaving you with update 2.
 
Level 2
Joined
Nov 26, 2019
Messages
10
Both triggers use the same event. Order of execution might be arbitary.
Call the update mulltiboard trigger yourself after having new Kill[] values. This way you can ensure the order of execution.
The trigger higher up in the Trigger Editor Hierarchy will be executed first, just tested it myself and that seems to be the case.
 
Last edited:
Level 8
Joined
Jun 26, 2019
Messages
317
upload_2019-11-26_14-11-0.png


This?
 
Level 7
Joined
Apr 1, 2019
Messages
153
Hey you can save alot of time making your trigger if you use loops.
Also if you use "0" for rows or columns it counts as all rows or columns
Here's your exact trigger with loops
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 4 columns and 7 rows, titled |cffcc33ffScoreboar...
      • Set Multiboard = (Last created multiboard)
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Multiboard - Set the icon for Multiboard item in column (Integer A), row 1 to UI\Minimap\MinimapIconCreepLoc.blp
      • For each (Integer A) from 2 to 7, do (Actions)
        • Loop - Actions
          • Multiboard - Set the icon for Multiboard item in column 1, row (Integer A) to ReplaceableTextures\CommandButtons\BTNFootman.blp
          • Multiboard - Set the icon for Multiboard item in column 2, row (Integer A) to UI\Feedback\Resources\ResourceGold.blp
          • Multiboard - Set the icon for Multiboard item in column 3, row (Integer A) to UI\Feedback\Resources\ResourceLumber.blp
          • Multiboard - Set the icon for Multiboard item in column 4, row (Integer A) to ReplaceableTextures\CommandButtons\BTNMarksmanship.blp
      • Multiboard - Set the width for Multiboard item in column 1, row 0 to 10.00% of the total screen width
      • For each (Integer A) from 2 to 5, do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Multiboard item in column (Integer A), row 0 to 12.00% of the total screen width
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to Players
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to Gold
      • Multiboard - Set the text for Multiboard item in column 3, row 1 to Lumber
      • Multiboard - Set the text for Multiboard item in column 4, row 1 to Units Killed
      • Multiboard - Set the text for Multiboard item in column 5, row 1 to Structures Destroyed
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for Multiboard item in column 1, row ((Integer A) + 1) to (PlayerColor[(Integer A)] + ((Name of (Player((Integer A)))) + |r))
          • Multiboard - Set the text for Multiboard item in column 2, row ((Integer A) + 1) to (String(((Player((Integer A))) Current gold)))
          • Multiboard - Set the text for Multiboard item in column 3, row ((Integer A) + 1) to (String(((Player((Integer A))) Current lumber)))
          • Multiboard - Set the text for Multiboard item in column 4, row ((Integer A) + 1) to (String(Kills[(Integer A)]))
      • Multiboard - Show Multiboard
  • Update Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to False
      • ((Triggering unit) is A ground unit) Equal to True
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set i = (Player number of (Owner of (Killing unit)))
      • Set Kills[i] = (Kills[i] + 1)
      • Multiboard - Set the text for Multiboard item in column 4, row (i + 1) to (String(Kills[i]))
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerColor[1] = |c00FF0303
      • Set PlayerColor[2] = |c000042FF
      • Set PlayerColor[3] = |c001CE6B9
      • Set PlayerColor[4] = |c00540081
      • Set PlayerColor[5] = |c00FFFC01
      • Set PlayerColor[6] = |c00fEBA0E
Setting an array of player colors is useful for use in other triggers.
It is also useful if you want to create the multiboard skipping over empty player slots like below:
  • Index Players
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, 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
            • Then - Actions
              • Set PlayerIndexedNumber = (PlayerIndexedNumber + 1)
              • Set PlayerPlaying[PlayerIndexedNumber] = (Integer A)
            • Else - Actions
      • Multiboard - Create a multiboard with 4 columns and (PlayerIndexedNumber + 1) rows, titled |cffcc33ffScoreboar...
      • Set Multiboard = (Last created multiboard)
      • For each (Integer A) from 1 to PlayerIndexedNumber, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for Multiboard item in column 1, row ((Integer A) + 1) to (PlayerColor[PlayerPlaying[(Integer A)]] + ((Name of (Player(PlayerPlaying[(Integer A)]))) + |r))
          • Multiboard - Set the text for Multiboard item in column 2, row ((Integer A) + 1) to (String(((Player(PlayerPlaying[(Integer A)])) Current gold)))
          • Multiboard - Set the text for Multiboard item in column 2, row ((Integer A) + 1) to (String(((Player(PlayerPlaying[(Integer A)])) Current lumber)))
          • Multiboard - Set the text for Multiboard item in column 4, row ((Integer A) + 1) to (String(Kills[PlayerPlaying[(Integer A)]]))
 
Last edited:
Top