• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Multiboard help

Status
Not open for further replies.
There isn't. That's made with a Jass script that allows going beyond GUI capabilities. It's related to GetLocalPlayer() look around that in the forum or google and you'll find your answer

Google search: Wacraft GetLocalPlayer() multiboard
 
Code:
function Trig_Multiboard_Copy_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    if ( not (GetLocalPlayer() == GetTriggerPlayer() ) ) then
        return false
    endif
    return true
endfunction
Fixed
 
A bit faster

JASS:
function Trig_Multiboard_Copy_Conditions takes nothing returns boolean
     return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true and GetLocalPlayer() == GetTriggerPlayer()
endfunction

Of course, be aware than GetLocalPlayer() may desync (drop everyone from the map) if not used correctly. Anything you do inside the GetLocalPlayer() block will happen only for that player, and if you do something like create a unit only for one player, he'll have a unit no one else has.
 
Then you have to create them for everybody, hide them, and show them inside GetLocalPlayer() block so, remains hidden for everybody except for the owner of the table. Of course, the Table data has to be update also for every player.

  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Multiboard - Create a multiboard with 1 columns and 1 rows, titled Multiboard Title
      • Set MB[(Player number of (Picked player))] = (Last created multiboard)
      • Multiboard - Hide (Last created multiboard)
      • Custom script: if GetLocalPlayer() == GetEnumPlayer() then
      • Multiboard - Show (Last created multiboard)
      • Custom script: endif
 
Uh, no. Don't do it that way. Creating/Destroying multiboards is crazy.

Create 1 multiboard to display the data of the selected unit. That's all. When a player selects a unit, update the hashtable to the data of that unit. No need to destroy/create more multiboards, when you can update them.
 
It's not just "my way". Creating multiboards requires a bunch of functions, and doing it several times for several players would lag your map.

It's a matter of efficiency.
 
Here is the final code and looks like work very fine
  • Multiboard1
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
      • Set M_board = (Load 1 of (Key (Triggering player)) in Hashtable)
      • Set Unit = (Triggering unit)
      • Custom script: set udg_Hash_key = GetHandleId(udg_Unit)
      • Set Accuracy = (Load 1 of Hash_key from Hashtable)
      • Set Evasion = (Load 2 of Hash_key from Hashtable)
      • Set Magic_evasion = (Load 3 of Hash_key from Hashtable)
      • Set Resist_rate = (Load 4 of Hash_key from Hashtable)
      • Set Critical_rate = (Load 5 of Hash_key from Hashtable)
      • Set Critical_damage = (Load 6 of Hash_key from Hashtable)
      • Set Spell_power = (Load 7 of Hash_key from Hashtable)
      • Set Movement = (Current movement speed of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 2 of (Key (Triggering player)) from Hashtable) Equal to False
        • Then - Actions
          • Multiboard - Create a multiboard with 5 columns and 5 rows, titled Show Status
          • Hashtable - Save True as 2 of (Key (Triggering player)) in Hashtable
          • Hashtable - Save Handle Of(Last created multiboard) as 1 of (Key (Triggering player)) in Hashtable
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Set Integer = (Integer A)
              • For each (Integer B) from 1 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the display style for (Last created multiboard) item in column Integer, row (Integer B) to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 4.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 2, row 1 to 8.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 3, row 1 to 1.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 4, row 1 to 8.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 5, row 1 to 5.00% of the total screen width
          • For each (Integer A) from 2 to 5, do (Actions)
            • Loop - Actions
              • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 8.00% of the total screen width
              • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 4.00% of the total screen width
              • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 2.00% of the total screen width
              • Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 8.00% of the total screen width
              • Multiboard - Set the width for (Last created multiboard) item in column 5, row (Integer A) to 5.00% of the total screen width
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an ally of (Triggering player)) Equal to True
            • Then - Actions
              • Multiboard - Change the title of (Last created multiboard) to (|cff2291BC(Allied)|r + (|cff01FF78 + ((Name of (Triggering unit)) + |r)))
            • Else - Actions
              • Multiboard - Change the title of (Last created multiboard) to (|cffFF0000(Hostille)|r + (|cff01FF78 + ((Name of (Triggering unit)) + |r)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an ally of (Triggering player)) Equal to True
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to |cff2291BCAccuracy:...
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to |cff2291BCEvasion:|r
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to |cff2291BCMagic Eva...
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to |cff2291BCResist Ra...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 2 to |cff2291BCCritical ...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 3 to |cff2291BCCritical ...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 4 to |cff2291BCSpell Pow...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 5 to |cff2291BCMovement:...
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String(Accuracy, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(Evasion, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(Magic_evasion, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(Resist_rate, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 2 to (String(Critical_rate, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 3 to (String(Critical_damage, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 4 to ( + (String((Integer(Spell_power)))))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 5 to ( + (String((Integer(Movement)))))
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for (Last created multiboard) item in column 2, row (Integer A) to (20.00%, 20.00%, 100.00%) with 0.00% transparency
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for (Last created multiboard) item in column 5, row (Integer A) to (20.00%, 20.00%, 100.00%) with 0.00% transparency
            • Else - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to |cff2291BCAccuracy:...
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to |cff2291BCEvasion:|r
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to |cff2291BCMagic Eva...
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to |cff2291BCResist Ra...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 2 to |cff2291BCCritical ...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 3 to |cff2291BCCritical ...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 4 to |cff2291BCSpell Pow...
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row 5 to |cff2291BCMovement:...
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String(Accuracy, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(Evasion, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(Magic_evasion, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(Resist_rate, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 2 to (String(Critical_rate, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 3 to (String(Critical_damage, 7, 2))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 4 to ( + (String((Integer(Spell_power)))))
              • Multiboard - Set the text for (Last created multiboard) item in column 5, row 5 to ( + (String((Integer(Movement)))))
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for (Last created multiboard) item in column 2, row (Integer A) to (100.00%, 0.00%, 0.00%) with 0.00% transparency
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for (Last created multiboard) item in column 5, row (Integer A) to (100.00%, 0.00%, 0.00%) with 0.00% transparency
          • Multiboard - Minimize (Last created multiboard)
          • Multiboard - Maximize (Last created multiboard)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an ally of (Triggering player)) Equal to True
            • Then - Actions
              • Multiboard - Change the title of M_board to (|cff2291BC(Allied)|r + (|cff01FF78 + ((Name of (Triggering unit)) + |r)))
            • Else - Actions
              • Multiboard - Change the title of M_board to (|cffFF0000(Hostille)|r + (|cff01FF78 + ((Name of (Triggering unit)) + |r)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an ally of (Triggering player)) Equal to True
            • Then - Actions
              • Multiboard - Set the text for M_board item in column 2, row 2 to (String(Accuracy, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 3 to (String(Evasion, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 4 to (String(Magic_evasion, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 5 to (String(Resist_rate, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 2 to (String(Critical_rate, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 3 to (String(Critical_damage, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 4 to ( + (String((Integer(Spell_power)))))
              • Multiboard - Set the text for M_board item in column 5, row 5 to ( + (String((Integer(Movement)))))
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for M_board item in column 2, row (Integer A) to (20.00%, 20.00%, 100.00%) with 0.00% transparency
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for M_board item in column 5, row (Integer A) to (20.00%, 20.00%, 100.00%) with 0.00% transparency
            • Else - Actions
              • Multiboard - Set the text for M_board item in column 2, row 2 to (String(Accuracy, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 3 to (String(Evasion, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 4 to (String(Magic_evasion, 7, 2))
              • Multiboard - Set the text for M_board item in column 2, row 5 to (String(Resist_rate, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 2 to (String(Critical_rate, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 3 to (String(Critical_damage, 7, 2))
              • Multiboard - Set the text for M_board item in column 5, row 4 to ( + (String((Integer(Spell_power)))))
              • Multiboard - Set the text for M_board item in column 5, row 5 to ( + (String((Integer(Movement)))))
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for M_board item in column 2, row (Integer A) to (100.00%, 20.00%, 20.00%) with 0.00% transparency
              • For each (Integer A) from 2 to 5, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the color for M_board item in column 5, row (Integer A) to (100.00%, 20.00%, 20.00%) with 0.00% transparency
              • Multiboard - Minimize (Last created multiboard)
              • Multiboard - Maximize (Last created multiboard)
      • Custom script: endif
 
No :) You create the multiboards on 0.00 elapsed gametime, then, update them locally when a unit is selected with unit data.

Your index for the Multioard Array is the player number of triggering player.
 
Status
Not open for further replies.
Back
Top