• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
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 64
Joined
Jan 18, 2005
Messages
27,232
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