• 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.

2 items multiboard

Status
Not open for further replies.
Level 3
Joined
Apr 4, 2012
Messages
64
can someone help me to make a multiboard to show how many kills player has from killing player 11 and the current income

player 11 its orcs, the enemie so kills is the number of units that 1 to 10 player kills of player 11


.............income.........kills..........
player.......xxx............yyy..........
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
If you only want to display the number of killed creeps you may use a Leaderboard instead of a Multiboard. If you want to display an aditional value, then a Multiboard.

I will help you to create a Multiboard only if you show me a first attemp to do it by yourself. I'll give you some info anyway.

NOTE: MULTIBOARD MUST BE created and modified on second 0, after Map initialization, not in MapInit trigger.

· Create an Integer Variable (I'll call it TInt) It means "Temporal Integer", and it will be used whenever you need to handle any non specific nor static integer value.
· Create an Integer Variable Array for Kill Count(I'll call it CreepKills)
· Create an Integer Variable Array for Income (I'll call it Income)
· Create a Multiboard Variable to handle the Multiboard (I'll call it MB)

You need A multiboard with 3 Columns (Player - Income - Kills) and 11 rows (10 players + Column denomination)
  • Multiboard - Create a multiboard with 3 columns and 10 rows, titled Multiboard
To improve system performance by A LOT you set that multiboard to a variable
  • Set MB = (Last created multiboard)
From now on, remember that whenever you read "MB" it's a reference to this Multiboard. Off course, MB is a Multiboard variable.

Now, Multiboard by default can display Icons and text, or just one of them on each box (column/row). I'll hide icons from all columns/rows and then make it display an icon only in the "Income" column 3/1 row. Also, set the size of all columns and rows to 6% of the screen

  • After Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 11 rows, titled Multiboard
      • Set MB = (Last created multiboard)
      • Multiboard - Show MB
      • Multiboard - Set the display style for MB item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for MB item in column 3, row 1 to Show text and Show icons
      • Multiboard - Set the icon for MB item in column 3, row 1 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the text for MB item in column 1, row 1 to Player
      • Multiboard - Set the text for MB item in column 2, row 1 to Kills
      • Multiboard - Set the text for MB item in column 3, row 1 to Income
      • Multiboard - Set the color for MB item in column 0, row 1 to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the width for MB item in column 0, row 0 to 6.00% of the total screen width
      • Multiboard - Minimize MB
      • Multiboard - Maximize MB
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TInt = (Integer A)
          • Multiboard - Set the text for MB item in column 1, row (TInt + 1) to (Name of (Player(TInt)))
Now we set the player kills and display it in the multiboard.

  • Multiboard Kills
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
    • Actions
      • Set TInt = (Player number of (Owner of (Killing unit)))
      • Set CreepKills[TInt] = (CreepKills[TInt] + 1)
      • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(CreepKills[TInt]))
I don't know how your income works.

From there on, you may be able to understand how it works, and do the rest of the things you want. You can also play with colors and stuff to make it look the way you want.
 
Level 3
Joined
Apr 4, 2012
Messages
64
If you only want to display the number of killed creeps you may use a Leaderboard instead of a Multiboard. If you want to display an aditional value, then a Multiboard.

I will help you to create a Multiboard only if you show me a first attemp to do it by yourself. I'll give you some info anyway.

NOTE: MULTIBOARD MUST BE created and modified on second 0, after Map initialization, not in MapInit trigger.

· Create an Integer Variable (I'll call it TInt) It means "Temporal Integer", and it will be used whenever you need to handle any non specific nor static integer value.
· Create an Integer Variable Array for Kill Count(I'll call it CreepKills)
· Create an Integer Variable Array for Income (I'll call it Income)
· Create a Multiboard Variable to handle the Multiboard (I'll call it MB)

You need A multiboard with 3 Columns (Player - Income - Kills) and 11 rows (10 players + Column denomination)
  • Multiboard - Create a multiboard with 3 columns and 10 rows, titled Multiboard
To improve system performance by A LOT you set that multiboard to a variable
  • Set MB = (Last created multiboard)
From now on, remember that whenever you read "MB" it's a reference to this Multiboard. Off course, MB is a Multiboard variable.

Now, Multiboard by default can display Icons and text, or just one of them on each box (column/row). I'll hide icons from all columns/rows and then make it display an icon only in the "Income" column 3/1 row. Also, set the size of all columns and rows to 6% of the screen

  • After Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 11 rows, titled Multiboard
      • Set MB = (Last created multiboard)
      • Multiboard - Show MB
      • Multiboard - Set the display style for MB item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for MB item in column 3, row 1 to Show text and Show icons
      • Multiboard - Set the icon for MB item in column 3, row 1 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the text for MB item in column 1, row 1 to Player
      • Multiboard - Set the text for MB item in column 2, row 1 to Kills
      • Multiboard - Set the text for MB item in column 3, row 1 to Income
      • Multiboard - Set the color for MB item in column 0, row 1 to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the width for MB item in column 0, row 0 to 6.00% of the total screen width
      • Multiboard - Minimize MB
      • Multiboard - Maximize MB
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TInt = (Integer A)
          • Multiboard - Set the text for MB item in column 1, row (TInt + 1) to (Name of (Player(TInt)))
Now we set the player kills and display it in the multiboard.

  • Multiboard Kills
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
    • Actions
      • Set TInt = (Player number of (Owner of (Killing unit)))
      • Set CreepKills[TInt] = (CreepKills[TInt] + 1)
      • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(CreepKills[TInt]))
I don't know how your income works.

From there on, you may be able to understand how it works, and do the rest of the things you want. You can also play with colors and stuff to make it look the way you want.

thank you very much but

how do u do these?
Set CreepKills[TInt] = (CreepKills[TInt] + 1)
Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(CreepKills[TInt]))

i tried cant do (CreepKills[TInt]) on the Multiboard kills the last 2 actions i cant do this the rest i managed to get
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1- Check in Multiboard Options for the one that says "Multiboard - Set text of item" or something like that, and modify the number after "row" to match (TInt + 1) using the Arithmetic function.

Whenever you do something with whole numbers you can select almost anything in the game which works with Integers like gold, food, player number, almost anything in math, etc. You can also select integer variables.

It's not "name: Player(Tint)". Whenever you are prompted to select a player you can do "Player - Convert player to player index" -> It will prompt you to select Player(index). Index is an integer.

When you create CreepKills as an integer variable ARRAY it will always prompt you tou select the variable index (CreepKills[Index]). That index is a number, an integer. That integer is TInt.

(String(CreepKills[TInt])) it's the "Convert Integer to String" function.
 
Level 3
Joined
Apr 4, 2012
Messages
64
And for income?

348pyzc.png
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
WC3 editor has "Copy as text" enabled for trigger. Just select the body you want to copy (Whole trigger / Just events / Just Conditions / Just Actions / If/Then/Else block, etc.) And Hive has enabled the interpretation of that inside [trigger][/trigger] tags.

Yeah, exactly. That's a way to add the Income.
 
Level 3
Joined
Apr 4, 2012
Messages
64
WC3 editor has "Copy as text" enabled for trigger. Just select the body you want to copy (Whole trigger / Just events / Just Conditions / Just Actions / If/Then/Else block, etc.) And Hive has enabled the interpretation of that inside [trigger][/trigger] tags.

Yeah, exactly. That's a way to add the Income.

thats my income system that is working i ment how to put it on multiboard and i still could figure the problem of that i sent u by pm the 2nd one.

  • actions
  • Set TInt = (Player number of (Owner of (Killing unit)))
  • Set creepkill = creepkill ???? >>>to work as player set so i can add the index i must change the variable for player type right? cuz u said it was integer
  • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to h? <<< same problem here
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Check the CreepKill variable and enable the "array" with default size. It will allow you to select an index. CreepKill[Index].

As said in my first post, you don't need any Player variable. Just CreepKills[Array], TInt, and Income integer variables.

Whenever you select an option which involves numbers (like the row number) you can select "Arithmetic" function which allows you to +, -, x, and / between different values. One of these values is "TInt".

The reason we do TInt + 1 is because Player 1 isn't in row 1, but in row 2. Same happens with all players. They're all one row over their player index. The logic relation between the player number and the player row is "Player Number +1". Being TInt = Player number, the logic comes to TInt + 1.
 
Level 3
Joined
Apr 4, 2012
Messages
64
Check the CreepKill variable and enable the "array" with default size. It will allow you to select an index. CreepKill[Index].

As said in my first post, you don't need any Player variable. Just CreepKills[Array], TInt, and Income integer variables.

Whenever you select an option which involves numbers (like the row number) you can select "Arithmetic" function which allows you to +, -, x, and / between different values. One of these values is "TInt".

The reason we do TInt + 1 is because Player 1 isn't in row 1, but in row 2. Same happens with all players. They're all one row over their player index. The logic relation between the player number and the player row is "Player Number +1". Being TInt = Player number, the logic comes to TInt + 1.

this is my income system how to i put it on multiboard so it has all player total income?
  • Income
    • Events
  • Time - IncomeTimer expires >>> i have a 8 sec timer
    • Conditions
    • Actions
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Player - Add Income[(Integer A)] to (Player((Integer A))) Current gold
 
Level 3
Joined
Apr 4, 2012
Messages
64
Exactly :) I forgot to mention that Income is also an Array.

How do you calculate your Income?

I have a 5 income base then theres 7 types of buildings that increase by different values example:

  • Castle
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Castle
    • Actions
      • Unit - Set the custom value of (Triggering unit) to 0
      • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + 10)
      • Unit - Replace (Triggering unit) with a Castle using The old unit's relative life and mana
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Income Improved by ...
(the income will decrease if the building gets destroyed ofc)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Why do you set custom value to 0? What are you using it for?

You repeat 6 times "Triggering Unit"
You repeat 3 times "Owner of..."
You repeat 2 times "Player Number..."
You leak 1 player group.

Every time you require some data the system looks for it and uses, but that reduces the eficiency, the system has to work more to do something that can be done easily. How? Helping the system.
  • Castle
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
    • Set TUnit = (Triggering Unit) <- Unit variable type.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-Type of TUnit) Equal to Castle
        • Then - Actions
          • Set TPlayer = (Owner of TUnit)
          • Set TInt = (Player number of TPlayer)
          • Set TForce = (Player group (TPlayer))
          • Unit - Set the custom value of TUnit to 0
          • Set Income[TInt] = (Income[Tint] + 10)
          • Unit - Replace TUnit with a Castle using The old unit's relative life and mana
          • Game - Display to TForce the text: Income Improved by ...
          • Custom script: call DestroyForce(udg_TForce)
        • Else - Actions
Whenever you're using something more than twice it's better if you set it into a variable. It goes smoothly and requires less job for the PC (and the maker too).

There you use Triggering Unit once, Player number once, and Player Group once. I also removed the leak with the custom script. So, from 11 repetitive functions and 1 leak we go to 3 functions and no leak. ¡Thank God for variables!
 
Level 3
Joined
Apr 4, 2012
Messages
64
Why do you set custom value to 0? What are you using it for?

You repeat 6 times "Triggering Unit"
You repeat 3 times "Owner of..."
You repeat 2 times "Player Number..."
You leak 1 player group.

Every time you require some data the system looks for it and uses, but that reduces the eficiency, the system has to work more to do something that can be done easily. How? Helping the system.
  • Castle
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
    • Set TUnit = (Triggering Unit) <- Unit variable type.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-Type of TUnit) Equal to Castle
        • Then - Actions
          • Set TPlayer = (Owner of TUnit)
          • Set TInt = (Player number of TPlayer)
          • Set TForce = (Player group (TPlayer))
          • Unit - Set the custom value of TUnit to 0
          • Set Income[TInt] = (Income[Tint] + 10)
          • Unit - Replace TUnit with a Castle using The old unit's relative life and mana
          • Game - Display to TForce the text: Income Improved by ...
          • Custom script: call DestroyForce(udg_TForce)
        • Else - Actions
Whenever you're using something more than twice it's better if you set it into a variable. It goes smoothly and requires less job for the PC (and the maker too).

There you use Triggering Unit once, Player number once, and Player Group once. I also removed the leak with the custom script. So, from 11 repetitive functions and 1 leak we go to 3 functions and no leak. ¡Thank God for variables!

thank you xD that is going to give me more 5 hours cuz change all of them and testing iam still a begginer :p no stress, but what about the multiboard income?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
The same way you do with Kills. Inside the "For each integer A" remember to reduce the amount of repetitite data search. A clue to do that is reduce the parentheses.
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Set TInt = (Integer A)
      • Player - Add Income[TInt] to (Player(TInt)) Current gold
      • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
But the income shouldn't be displayed in the Multiboard there. It should be displayed whenever the player does something that manipulates his income.
This function Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt])) should be in the Castle trigger we discussed before, and in all the others that manipulate the Income. Those that increase it and those that reduces it.
 
Level 3
Joined
Apr 4, 2012
Messages
64
The same way you do with Kills. Inside the "For each integer A" remember to reduce the amount of repetitite data search. A clue to do that is reduce the parentheses.
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Set TInt = (Integer A)
      • Player - Add Income[TInt] to (Player(TInt)) Current gold
      • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
But the income shouldn't be displayed in the Multiboard there. It should be displayed whenever the player does something that manipulates his income.
This function Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt])) should be in the Castle trigger we discussed before, and in all the others that manipulate the Income. Those that increase it and those that reduces it.
what type of event do i put? lol
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Castle
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
    • Set TUnit = (Triggering Unit) <- Unit variable type.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-Type of TUnit) Equal to Castle
        • Then - Actions
          • Set TPlayer = (Owner of TUnit)
          • Set TInt = (Player number of TPlayer)
          • Set TForce = (Player group (TPlayer))
          • Unit - Set the custom value of TUnit to 0
          • Set Income[TInt] = (Income[Tint] + 10)
          • Unit - Replace TUnit with a Castle using The old unit's relative life and mana
          • Game - Display to TForce the text: Income Improved by ...
          • Custom script: call DestroyForce(udg_TForce)
        • Else - Actions
As I said... Update the Multiboard data only when it changes like in the previous trigger. You just have to add the Multiboard update action to all the triggers you have to increase/reduce the income of any player

  • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
That would be, obviously, after setting TInt = Player Number of Owner of Triggering Unit. Using or not the involved variables, like in the trigger

  • Set TInt = (Player number of TPlayer)
Knowing that TPlayer already means "Owner of TUnit" and Knowing that TUnit already means "Triggering Unit".
 
Level 3
Joined
Apr 4, 2012
Messages
64
  • Castle
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
    • Set TUnit = (Triggering Unit) <- Unit variable type.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-Type of TUnit) Equal to Castle
        • Then - Actions
          • Set TPlayer = (Owner of TUnit)
          • Set TInt = (Player number of TPlayer)
          • Set TForce = (Player group (TPlayer))
          • Unit - Set the custom value of TUnit to 0
          • Set Income[TInt] = (Income[Tint] + 10)
          • Unit - Replace TUnit with a Castle using The old unit's relative life and mana
          • Game - Display to TForce the text: Income Improved by ...
          • Custom script: call DestroyForce(udg_TForce)
        • Else - Actions
As I said... Update the Multiboard data only when it changes like in the previous trigger. You just have to add the Multiboard update action to all the triggers you have to increase/reduce the income of any player

  • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
That would be, obviously, after setting TInt = Player Number of Owner of Triggering Unit. Using or not the involved variables, like in the trigger

  • Set TInt = (Player number of TPlayer)
Knowing that TPlayer already means "Owner of TUnit" and Knowing that TUnit already means "Triggering Unit".

So it should be like this?

well income doesnt work, kills is working fine but only starts when i kill, cant i put so its starts with number 0.

this on the multiboard

  • Castle Destroyed
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Castle
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Equal to 0
        • Then - Actions
          • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 22)
          • Player Group - Make (All allies of (Owner of (Triggering unit))) treat (Player group((Owner of (Triggering unit)))) as an Ally
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Lost 22 income
          • For each (Integer A) from 1 to 10, do (Actions)
            • Loop - Actions
              • Set TInt = (Integer A)
              • Player - Add Income[TInt] to (Player(TInt)) Current gold
              • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
        • Else - Actions
          • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 12)
          • Player Group - Make (All allies of (Owner of (Triggering unit))) treat (Player group((Owner of (Triggering unit)))) as an Ally
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Lost 12 income
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
OMG No... Your income trigger is fine, but the Multiboard Income update doesn't belong to that trigger. BDW, you aren't working with the variables as I showed before.

Just add the following function after modifying the Income variable in any trigger. Doesn't have to be a Loop Integer A (that's just when you give away the money). You can use the specific player involved in the trigger to update only his data.
  • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
Or it's harder-less efficient-slower-lame relative
  • Multiboard - Set the text for MB item in column 2, row ((Player Number of (Owner of (Triggering Unit))) + 1) to (String(Income[(Player Number of (Owner of (Triggering Unit)))]))
 
Level 3
Joined
Apr 4, 2012
Messages
64
OMG No... Your income trigger is fine, but the Multiboard Income update doesn't belong to that trigger. BDW, you aren't working with the variables as I showed before.

Just add the following function after modifying the Income variable in any trigger. Doesn't have to be a Loop Integer A (that's just when you give away the money). You can use the specific player involved in the trigger to update only his data.
  • Multiboard - Set the text for MB item in column 2, row (TInt + 1) to (String(Income[TInt]))
Or it's harder-less efficient-slower-lame relative
  • Multiboard - Set the text for MB item in column 2, row ((Player Number of (Owner of (Triggering Unit))) + 1) to (String(Income[(Player Number of (Owner of (Triggering Unit)))]))

ok srry now iam ultra confused.... hahaha iam not working with the code u gave cuz i have 10 other and i wanted to make it work b4 changing to the code u made. ammm so what do i put on the building destroy function? and do i need a income trigger for the multiboard? if i do can u post it? and what do i put on the normal building that adds income?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Those 2 functions you quoted are exactly the same, the thing is the first one is efficient and requires setting the TInt before doing the action, the second isn't and doesn't require the TInt.

That action just updates the multiboard, and, by the way, Income is in Colum 3, not Column 2 (unless you changed the whole Multiboard setting to swap the columns).

You just need to update the Multiboard data when the Income variable changes for any player. That's what you have to do. Whenever income is increased or reduced in any trigger, add that multiboard action to update the Multiboard aswell.
 
Level 3
Joined
Apr 4, 2012
Messages
64
Those 2 functions you quoted are exactly the same, the thing is the first one is efficient and requires setting the TInt before doing the action, the second isn't and doesn't require the TInt.

That action just updates the multiboard, and, by the way, Income is in Colum 3, not Column 2 (unless you changed the whole Multiboard setting to swap the columns).

You just need to update the Multiboard data when the Income variable changes for any player. That's what you have to do. Whenever income is increased or reduced in any trigger, add that multiboard action to update the Multiboard aswell.

srry about all the trouble it works xD by the way how can i make it so on multiboard the kills start with the value 0 and the income with the value 5?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
For Kills: Run a loop from 2 to 11 and set the text from the second column and row (Integer A) to display the text "0".

For income: Well... after setting each player income to 5, run the loop from 1 to 10 and update the Income data of each player.
 
Level 3
Joined
Apr 4, 2012
Messages
64
For Kills: Run a loop from 2 to 11 and set the text from the second column and row (Integer A) to display the text "0".

For income: Well... after setting each player income to 5, run the loop from 1 to 10 and update the Income data of each player.

how do i make so it only apears the players that are playing?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Damn... That's killing me. I've been looking at the screen for 10 minutes without knowing what to do. I'll edit this when I find a solution.

I hope it works. The following trigger sets players x y z to Players[1, 2, 3]. As example, if Player 1, 4, 5, 7, 9 are playing.
Players[1] = 1
Players[2] = 4
Players[3] = 5
Players[4] = 7
Players[5] = 9

So it creates 1 row for headers + 5 which are "PlayerPlaying"

  • After Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TForce = (All players controlled by a User player)
      • Set PlayersPlaying = (Number of players in TForce)
      • Multiboard - Create a multiboard with 3 columns and (PlayersPlaying + 1) rows, titled Multiboard
      • Set MB = (Last created multiboard)
      • Player Group - Pick every player in TForce and do (Actions)
        • Loop - Actions
          • Set TInt = (TInt + 1)
          • Set Players[TInt] = (Picked player)
      • Multiboard - Show MB
      • Multiboard - Set the display style for MB item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for MB item in column 3, row 1 to Show text and Show icons
      • Multiboard - Set the icon for MB item in column 3, row 1 to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the text for MB item in column 1, row 1 to Player
      • Multiboard - Set the text for MB item in column 2, row 1 to Kills
      • Multiboard - Set the text for MB item in column 3, row 1 to Income
      • Multiboard - Set the color for MB item in column 0, row 1 to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the width for MB item in column 0, row 0 to 6.00% of the total screen width
      • Multiboard - Minimize MB
      • Multiboard - Maximize MB
      • For each (Integer A) from 1 to PlayersPlaying, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for MB item in column 1, row ((Integer A) + 1) to (Name of Players[(Integer A)])
      • Custom script: call DestroyForce(udg_TForce)
As you can see, it updates Row (Integer A + 1) since players are one row over their player number. But here we don't set the Rows based on the player number (since player 7 should be on row 8, we have it on row 4), but we set it based on the Players[Index] variable which has them in order.

  • Multiboard Kills
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
    • Actions
      • Set TInt = (Player number of (Owner of (Killing unit)))
      • Set CreepKills[TInt] = (CreepKills[TInt] + 1)
      • For each (Integer A) from 1 to PlayersPlaying, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for MB item in column 2, row ((Integer A) + 1) to (String(CreepKills[(Player number of Players[(Integer A)])]))
· As you can see, the loop goes from 1 to PlayersPlaying (In this example, we have 5 players so, it goes from 1 to 5)
· It updates the row ((Integer A) + 1) so, if A=1, it updates Row 2.

Players[1] = Row 2
Players[2] = Row 3
Players[3] = Row 4
Players[4] = Row 5
Players[5] = Row 6

· And sets the CreepKills of Player number of Players[(Integer A)]

Integer A=1 = CreepKills[Players[1]] = Player 1 = 1
Integer A=2 = CreepKills[Players[2]] = Player 4 = 4
Integer A=3 = CreepKills[Players[3]] = Player 5 = 5
Integer A=4 = CreepKills[Players[4]] = Player 7 = 7
Integer A=5 = CreepKills[Players[5]] = Player 9 = 9

So, it displays CreepKills[1, 4, 5, 7, 9] on rows [2, 3, 4, 5, 6] based on stored Players[1, 2, 3, 4, 5]

CreepKills[Index] is based on Player Number, but the Player Number is the Player Number of "Players[Index]", so we have to look also for the Index of "Players" variable, which we loop with Integer A.

Damn, I feel like I solved world hunger and child abuse... I think there must be a better way to do this, but I don't know how. You have to display the Income the same way I did the kills. But you can easily set Income[Player number] and CreepKils[Player number] based on the real player (1, 4, 5, 7, 9) Doesn't matter. You can also give the Bounty with no trouble using Income[Player number of Picked player] or [Player number of (Player(Integer A))]

To update the Income Multiboard data you have to use this
  • For each (Integer A) from 1 to PlayersPlaying, do (Actions)
    • Loop - Actions
      • Multiboard - Set the text for MB item in column 3, row ((Integer A) + 1) to (String(Income[(Player number of Players[(Integer A)])]))
· PlayersPlaying is an Integer Variable
· TForce is a Player Group variable
· Players[Index] is an Integer Variable Array.
 
Last edited:
Status
Not open for further replies.
Top