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

Show multiboard for each player

Status
Not open for further replies.
Level 12
Joined
Apr 16, 2010
Messages
584
hi everybody. Some time passed and i forgot how to show multiboard to each player. Well i remember the scripts but i just can handle it, don't remember :p
So i need to create a board for each player.
  • M Create 1
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for Multiboard[(Integer A)] item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Create a multiboard with 2 columns and 4 rows, titled Sniper Battle
          • Set Multiboard[(Integer A)] = (Last created multiboard)
          • -------- Rows here --------
          • Multiboard - Hide Multiboard[(Integer A)]
          • Custom script: if ( GetLocalPlayer() == Player(GetForLoopIndexA()) ) then
          • Multiboard - Show Multiboard[(Integer A)]
          • Custom script: endif
This is my trigger, it wont show board at all, any suggestions?
 
Another problem: first you set the style of the multiboard, and THEN you create it (mr. obvious says that doesn't work).
Another issue: instead of "GetForLoopIndexA()", use "bj_forLoopAIndex".

I tested your case and it indeed doesn't work.
Apparently this does though:

  • Melee Initialization
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Multiboard - Create a multiboard with 2 columns and 2 rows, titled Title
          • Set MB[(Integer A)] = (Last created multiboard)
          • Multiboard - Set the display style for MB[(Integer A)] item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Hide MB[(Integer A)]
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex-1) then
          • Multiboard - Show MB[(Integer A)]
          • Custom script: endif
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
Multiboards defualt to visible. As such you overwrite the current local multiboard after each itteration of the loop. You also run some code with 144 itterations when no itteration is needed at all.

Firstly, create and set up all multiboards in a loop and set them to an array, making sure to hide each one after it is created.

Then to display all multiboards, make the multiboard at index player number of GetLocalPlayer() visible. This means that no itteration or comparision is used at all to display the multiboard locally (O(1) instead of O(n)). It also does not itterate stupidly over slots which can not possibly be returned from GetLocalPlayer (only active human players can be returned).
 
Status
Not open for further replies.
Top