Adding kill counts to multiboard

neetmaster

New Member
Reaction score
0
I have this multiboard and I'm also having problem setting it.
Trigger:
  • Multiboard Kills Setup
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and (Number of players in PlayingPlayers) rows, titled Units Killed
      • Set multiboard_UnitsKilled = (Last created multiboard)
        • Do Multiple ActionsFor each (Integer A) from 1 to (Number of players in PlayingPlayers), do (Actions)
          • Loop - Actions
            • Multiboard - Set the display style for multiboard_UnitsKilled item in column 1, row (Integer A) to Show text and Hide icons
            • Multiboard - Set the display style for multiboard_UnitsKilled item in column 2, row (Integer A) to Show text and Hide icons
            • Player Group - Pick every player in PlayingPlayers and do (Actions)
              • Loop - Actions
                • Multiboard - Set the text for multiboard_UnitsKilled item in column 1, row (Integer A) to ((Name of (Picked player)) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" />
            • Multiboard - Set the text for multiboard_UnitsKilled item in column 2, row (Integer A) to 0
            • Multiboard - Set the width for multiboard_UnitsKilled item in column 1, row (Integer A) to 15.00% of the total screen width
      • Multiboard - Show multiboard_UnitsKilled
      • Multiboard - Maximize multiboard_UnitsKilled


Only if a player is playing, it makes a row for him.
So if there's 3 players playing from the start there will be 2 rows.


What i want is :
If a player kills a unit, it adds to the column2 and the row in which the player is at.
The problem is how do i point which row should the data go in?
 

JeveKnight

New Member
Reaction score
2
I believe you would have to make a variable called PlayerRow or something and make it an Integer Array (12)
You would also have to make a variable KillCount, and make it an Integer Array (12) as well.

Trigger:
  • Unit - A unit Dies
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an enemy of (Owner of (Killing unit))) Equal to (==) True
        • Then - Actions
          • Set KillCount[(Player number of (Owner of (Killing unit)))] = (KillCount[(Player number of (Owner of (Killing unit)))] + 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row PlayerRow[(Player number of (Owner of (Killing unit)))] to (String(KillCount[(Player number of (Owner of (Killing unit)))]))


That should work.
 

neetmaster

New Member
Reaction score
0
I believe you would have to make a variable called PlayerRow or something and make it an Integer Array (12)
You would also have to make a variable KillCount, and make it an Integer Array (12) as well.

Trigger:
  • Unit - A unit Dies
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an enemy of (Owner of (Killing unit))) Equal to (==) True
        • Then - Actions
          • Set KillCount[(Player number of (Owner of (Killing unit)))] = (KillCount[(Player number of (Owner of (Killing unit)))] + 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row PlayerRow[(Player number of (Owner of (Killing unit)))] to (String(KillCount[(Player number of (Owner of (Killing unit)))]))


That should work.

What if the player number is say, 5 but he's in the row 2 or something?
 

JeveKnight

New Member
Reaction score
2
The trigger should still work, even if player 5 is in row 2.
I tested it in-game and it worked properly for me.
If you notice any problems, tell me.

Also, if you want set colors for each person on the multiboard this will work fine:

Trigger:
  • Colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Color[1] = |cffff0000
      • Set Color[2] = |cff0000ff
      • Set Color[3] = |cff00ffff
      • Set Color[4] = |cff660099
      • Set Color[5] = |cffffff00
      • Set Color[6] = |cffff9933
      • Set Color[7] = |cff00ff00
      • Set Color[8] = |cffff00ff
      • Set Color[9] = |cffcccccc
      • Set Color[10] = |cff99ccff
      • Set Color[11] = |cff336600
      • Set Color[12] = |cff663333


Color is a String Array variable (12)

Then, for the multiboard creation you would have to do something like this:


Trigger:
  • Create Multi
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and 1 rows, titled Player Stats
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Player name
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Kills
      • Player Group - Pick every player in ThePlayers and do (Actions)
        • Loop - Actions
          • Multiboard - Change the number of rows for (Last created multiboard) to ((Number of rows in (Last created multiboard)) + 1)
          • Set PlayerRow[(Player number of (Picked player))] = (Number of rows in (Last created multiboard))
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row PlayerRow[(Player number of (Picked player))] to ((Color[(Player number of (Picked player))] + (Name of (Picked player))) + |r)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row PlayerRow[(Player number of (Picked player))] to 0
            • Do Multiple ActionsFor each (Integer A) from 1 to ((Number of players in ThePlayers) + 1), do (Actions)
              • Loop - Actions
                • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 12.00% of the total screen width
                • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 4.00% of the total screen width
      • Multiboard - Maximize (Last created multiboard)


There is a variable called ThePlayers and you would initialize it like this:

Trigger:
  • PlayerGroup
    • Events
      • Time - Elapsed game time is 0.03 seconds
    • Conditions
    • Actions
      • If ((Player 1 (Red) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 1 (Red) to ThePlayers) else do (Do nothing)
      • If ((Player 2 (Blue) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 2 (Blue) to ThePlayers) else do (Do nothing)
      • If ((Player 3 (Teal) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 3 (Teal) to ThePlayers) else do (Do nothing)
      • If ((Player 4 (Purple) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 4 (Purple) to ThePlayers) else do (Do nothing)
      • If ((Player 5 (Yellow) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 5 (Yellow) to ThePlayers) else do (Do nothing)
      • If ((Player 6 (Orange) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 6 (Orange) to ThePlayers) else do (Do nothing)
      • If ((Player 7 (Green) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 7 (Green) to ThePlayers) else do (Do nothing)
      • If ((Player 8 (Pink) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 8 (Pink) to ThePlayers) else do (Do nothing)
      • If ((Player 9 (Gray) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 9 (Gray) to ThePlayers) else do (Do nothing)
      • If ((Player 10 (Light Blue) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 10 (Light Blue) to ThePlayers) else do (Do nothing)
      • If ((Player 11 (Dark Green) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 11 (Dark Green) to ThePlayers) else do (Do nothing)
      • If ((Player 12 (Brown) slot status) Equal to (==) Is playing) then do (Player Group - Add Player 12 (Brown) to ThePlayers) else do (Do nothing)


ThePlayers is a player group variable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top