I HATE MULTIBOARD. Few questions.

Level 18
Joined
Jun 2, 2009
Messages
1,233
WARNING! I KNOW IT IS NOT PRACTICAL. STILL EXPERIMENTING ON THIS SYSTEM.
I will be happy if you can shrink my mass of triggers.

  • Setting Up Copy Copy Copy
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set MultiboardWidth[1] = 7.00
      • Set MultiboardWidth[2] = 5.00
      • Set MultiboardWidth[3] = 5.00
      • Multiboard - Create a multiboard with 3 columns and 11 rows, titled Multiboard
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to MultiboardWidth[1]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 2 to MultiboardWidth[1]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 3 to MultiboardWidth[1]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 1 to MultiboardWidth[2]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 2 to MultiboardWidth[2]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 3 to MultiboardWidth[2]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 1 to MultiboardWidth[3]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 2 to MultiboardWidth[3]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 3 to MultiboardWidth[3]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 1 to MultiboardWidth[4]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 2 to MultiboardWidth[4]% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 3 to MultiboardWidth[4]% of the total screen width
      • Multiboard - Minimize (Last created multiboard)
      • Multiboard - Maximize (Last created multiboard)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to 1-1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to (Name of Player 3 (Teal))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to (Name of Player 4 (Purple))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to (Name of Player 5 (Yellow))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to (Name of Player 6 (Orange))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 6 to (Name of Player 7 (Green))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 7 to (Name of Player 8 (Pink))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 8 to (Name of Player 9 (Gray))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 9 to (Name of Player 10 (Light Blue))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 10 to (Name of Player 11 (Dark Green))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 11 to (Name of Player 12 (Brown))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to 1-3
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to 2-1
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to 2-2
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to 2-3
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to 3-1
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to 3-2
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 3 to 3-3
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to 4-1
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 2 to 4-2
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 3 to 4-3
Question 1: Check the attachment. Why still i can see icons? 99.png
Question 2: How can i make my trigger is "better" i mean "less triggers"
I know how do you think "you already created ai system for moba and shared it with us and you cannot do this simple process?"
Yes i cannot.


Player 1: TEAM 1
Player 2: TEAM 2

3-4-5-6-7 allies of TEAM 1
8-9-10-11-12 allies of TEAM 2

I just want to create simple board for the hero kills and number of deaths for players.

Question 3 comes after these fixes.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I'm just stopping by for a second and I didn't read everything, but you should look into using For Loops:
  • For each (integer MyInteger) from 1 to 3 do (Actions)
    • Loop - Actions
      • Multiboard - Set the width for Multiboard item in column 1, row MyInteger to MultiboardWidth[1]% of the total screen width
Also, looping over Player Groups as well:
  • Player Group - Pick every player in USERS and do (Actions)
    • Loop - Actions
      • Set Variable PN = (Player number of (Picked player))
      • Multiboard - Set the text for Multiboard item in column 1, row (PN + 1) to (Name of (Picked player))
Lastly, you're tracking your Multiboard in a variable:
  • Set Multiboard = (Last created multiboard)
Then you NEVER use this variable.
 
Level 18
Joined
Jun 2, 2009
Messages
1,233
Now i can see p4 and p8 in the board. But still icons are visible. @Uncle

  • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Multiboard - Set the display style for Multiboard item in column (Integer A), row (Integer A) to Show text and Hide icons
Because it hides to 1,1 2,2 3,3 and goes like this. I want to select "all rows and columns" but how


UPDATE: Ok i have solved this part. I will ask more until i done.

  • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Multiboard - Set the display style for Multiboard item in column 1, row (Integer A) to Show text and Hide icons
    • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Multiboard - Set the display style for Multiboard item in column 2, row (Integer A) to Show text and Hide icons
    • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Multiboard - Set the display style for Multiboard item in column 3, row (Integer A) to Show text and Hide icons
 

Attachments

  • 1731598971609.png
    1731598971609.png
    143 KB · Views: 9
Last edited:
Level 18
Joined
Jun 2, 2009
Messages
1,233
Ok here is the new issue. As you can see there are lot of spaces in there. I do not want to create space for unused players.



  • Setting Up Copy Copy Copy Copy Copy Copy
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set MultiboardWidth[1] = 7.00
      • Set MultiboardWidth[2] = 5.00
      • Set MultiboardWidth[3] = 5.00
      • Multiboard - Create a multiboard with 3 columns and 11 rows, titled Multiboard
      • Set Multiboard = (Last created multiboard)
        • Do Multiple ActionsFor each (Integer PN) from 1 to 3, do (Actions)
          • Loop - Actions
            • Multiboard - Set the width for Multiboard item in column 1, row PN to MultiboardWidth[1]% of the total screen width
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Set PN = (Player number of (Picked player))
          • Multiboard - Set the text for Multiboard item in column 1, row (PN + 1) to (Name of (Picked player))
      • Multiboard - Minimize (Last created multiboard)
      • Multiboard - Maximize (Last created multiboard)
      • 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 1, row 3 to 1-3
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Kills
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to 2-2
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to 2-3
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Deaths
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to 3-2
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 3 to 3-3
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiboard - Set the display style for Multiboard item in column 2, row (Integer A) to Show text and Hide icons
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiboard - Set the display style for Multiboard item in column 3, row (Integer A) to Show text and Hide icons
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiboard - Set the display style for Multiboard item in column 1, row (Integer A) to Show text and Hide icons
1731600219395.png
 
Level 18
Joined
Jun 2, 2009
Messages
1,233
It seems i made many things but still i cannot complete it. I think it is the best sharing the map and tell what i want. Because it is extremely complicated to me.

Player 1 = Team 1
Player 2 = Team 2
Player 3 to 7 are allies of P1 (TEAM 1)
Player 8 to 12 are allies of P2 (TEAM 2)

Example: Player 3 and Player 5 VS Player 7 VS Player 8
I want to see multiboard just like this

1732127877431.png


Update: It seems finally i did it. I will share the entire trigger when i am done.
 

Attachments

  • i hate multiboards.w3x
    24.2 KB · Views: 3
Last edited:

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
Just gonna chime in to say that ideally you wouldn't use multiboards to begin with.

Multiboards are functional but they're an ugly, clunky and inferior version of what you'd use the "new" UI natives for.
Now, this also comes with increased complexity but there are a lot of tutorials for it in the tutorial section and there is a tool to allow you to create UI elements with a program instead of learning to code.

You don't have to learn the UI natives but I am just saying there is a 'better' solution if you hate working with multiboards anyway, maybe its worth a try.
 
Last edited:
Level 29
Joined
Sep 26, 2009
Messages
2,594
@JFAMAP you should just stop hectically changing things and instead take a proper look at what you are doing in your triggers.
First of all, you have this:
  • Multiboard - Create a multiboard with 3 columns and 11 rows, titled Multiboard
Since you are constantly creating a board of 11 rows, why do you even expect that some rows will be magically hidden?
The number of rows in the multiboard should obviously be calculated.
You can check player type and status via conditions like these:
  • Conditions
    • (Player 1 (Red) controller) Equal to User
    • (Player 1 (Red) slot status) Equal to Is playing
If you apply that on your 'Players' player group, you should get the number of active non-PC players.
Add to that +3, because you want to display three additional rows in the board (the header row + one row called 'Clan devil' and second 'Clan reaper').
That final number is the number of rows your multiboard should have.

Next, you do this:
  • Player Group - Pick every player in Players and do (Actions)
    • Loop - Actions
      • Set PN = (Player number of (Picked player))
      • Multiboard - Set the text for Multiboard item in column 1, row (PN + 1) to (Name of (Picked player))
This literally says: "Set player's name into the board at row (player's_number + 1)"
So the question is similar to my previous one: Why would you expect the multiboard to NOT contain empty rows? The code literally means that for example player 7 will always be placed in row 8 (=7+1) in the multiboard.

The solution here is simple: use separate integer variable that will represent current row. Let's simply call that variable RowNumber. At map start this variable would have value '2' (since first two rows are already taken - first is header row, second is 'Clan devil' row).
The trigger would then look like this:
  • Player Group - Pick every player in Players and do (Actions) //assuming here that 'Players' player group is already filtered to only contain active non-PC players, as I've mentioned earlier.
    • Loop - Actions
      • Set RowNumber = RowNumber + 1
      • Multiboard - Set the text for Multiboard item in column 1, row RowNumber to (Name of (Picked player))
This way, if for example only players Player 2 (Blue) and Player 7 (Green) are playing at the start of the game, then Player 2 (Blue) would be assigned to row 3 and Player 7 (Green) to row 4.

Finally, you have these loops:
  • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
I mean ... why do you even have three loops that do the same thing just for different columns? Why not use a single loop that contains all 3 multiboard actions?
Second of all, why do you even loop 12 times when your board has 11 rows? This should iterate just over the number of rows you actually have in the multiboard (i.e. the calculated value I've mentioned at the start of this post).

Also, you can nest loops, so you can have one loop that iterates X times (for each row in multiboard) and inside it a second loop that iterates Y times (for each column in the multiboard).
  • Do Multiple ActionsFor each rowNum from 1 to 11, do (Actions)
    • Loop - Actions
      • Do Multiple ActionsFor each colNum from 1 to 3, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for Multiboard item in column colNum, row rowNum to Show text and Hide icons
 
Level 18
Joined
Jun 2, 2009
Messages
1,233
Ah i am very sorry @Nichilus i was already succeed many things before your message and updated my message. Now it seems i am on the last step. I will share the system when i am done for anyone who might need it.
It is NOT VERY DIFFICULT after you get it. But until you learn it is a pain in the ass.
 
Top