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

Multiboard

Status
Not open for further replies.
Level 3
Joined
Aug 16, 2012
Messages
21
Looking for a multiboard like used in Greece.

I want three categories; Power (Cities owned. [Cities are captured like Greece]), Allies (Number of allies a nation has), and Power (Militiary units owned)

Also, instead of the name being the player's name, I'd like it to be the faction. (Sparta, Athens, etc., for example.)

Thank you in advance for any help.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Map attached.

General Info:
Column 1: The faction name.
Column 2: Cities owned.
Column 3: Allies.
Column 4: Power.

Row: if you add 1 to the player number, you will get the row for that player.
E.g.: Blue's row would be 3 (player number of blue is 2, +1 = 3).

"multiboard" is the variable used to access the multiboard.

colorCode[X] is the color code for that player. You can use this in all other triggers as well (if you ever want to show the player's name in his correct color, for example).
This can be done with Concatenate Strings: "colorCode[number] + 'Player name' + "|r" ".

faction[X] is the faction name of that player (the faction of blue will be faction[2]).
Thus you can easily retrieve the faction for each individual player.

How to use:
If you want to change the faction of the player (mostly to grey it out when the player left), you can change the text of Column 1, Row (player number + 1).
  • Player Leaves Game
    • 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
    • Conditions
    • Actions
      • Multiboard - Set the text for multiboard item in column 1, row ((Player number of (Triggering player)) + 1) to ((|c00666666 + factions[(Player number of (Triggering player))]) + |r)

To change the amount of cities owned, you most likely need another variable to count the cities.
This variable would also need an array for simplicity's sake. I will call it "citiesOwned" for now (integer variable with array).
When a player conquers a village, set citiesOwned[Player number] + 1. Then set the multiboard value in row 2 to that variable (with that same array).
Do not forget to reduce the citiesOwned for the player that loses the village.


The same goes for allies: create a variable that counts the amount of allies and increase/decrease it when a player gains/loses an ally.

For power, you do need a variable, but not with an array. I will call the variable "tempGroup (unit group variable, no array).
set the variable to "all units owned by [player]", then set the multiboard value in column 4 and the correct row to "units in tempGroup".
When all is said and done, remove the unit group leak (too much leaks will slow down the game).
The easiest would be to do this with a loop (loop from 1 to 12, pick all units owned by player[loopInt], change the multiboard text and then destroy the unit group).

  • Update Power
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set tempGroup = (Units owned by (Player((Integer A))))
          • Multiboard - Set the text for multiboard item in column 4, row ((Integer A) + 1) to (String((Number of units in tempGroup)))
          • Custom script: call DestroyGroup( udg_tempGroup )
 

Attachments

  • Multiboard Request 2.w3x
    16.1 KB · Views: 42
Level 6
Joined
Mar 6, 2010
Messages
116
Map attached.

General Info:
Column 1: The faction name.
Column 2: Cities owned.
Column 3: Allies.
Column 4: Power.

Row: if you add 1 to the player number, you will get the row for that player.
E.g.: Blue's row would be 3 (player number of blue is 2, +1 = 3).

"multiboard" is the variable used to access the multiboard.

colorCode[X] is the color code for that player. You can use this in all other triggers as well (if you ever want to show the player's name in his correct color, for example).
This can be done with Concatenate Strings: "colorCode[number] + 'Player name' + "|r" ".

faction[X] is the faction name of that player (the faction of blue will be faction[2]).
Thus you can easily retrieve the faction for each individual player.

How to use:
If you want to change the faction of the player (mostly to grey it out when the player left), you can change the text of Column 1, Row (player number + 1).
  • Player Leaves Game
    • 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
    • Conditions
    • Actions
      • Multiboard - Set the text for multiboard item in column 1, row ((Player number of (Triggering player)) + 1) to ((|c00666666 + factions[(Player number of (Triggering player))]) + |r)

To change the amount of cities owned, you most likely need another variable to count the cities.
This variable would also need an array for simplicity's sake. I will call it "citiesOwned" for now (integer variable with array).
When a player conquers a village, set citiesOwned[Player number] + 1. Then set the multiboard value in row 2 to that variable (with that same array).
Do not forget to reduce the citiesOwned for the player that loses the village.


The same goes for allies: create a variable that counts the amount of allies and increase/decrease it when a player gains/loses an ally.

For power, you do need a variable, but not with an array. I will call the variable "tempGroup (unit group variable, no array).
set the variable to "all units owned by [player]", then set the multiboard value in column 4 and the correct row to "units in tempGroup".
When all is said and done, remove the unit group leak (too much leaks will slow down the game).
The easiest would be to do this with a loop (loop from 1 to 12, pick all units owned by player[loopInt], change the multiboard text and then destroy the unit group).

  • Update Power
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set tempGroup = (Units owned by (Player((Integer A))))
          • Multiboard - Set the text for multiboard item in column 4, row ((Integer A) + 1) to (String((Number of units in tempGroup)))
          • Custom script: call DestroyGroup( udg_tempGroup )

Thanks.That helped me a lot :)
 
Status
Not open for further replies.
Top