• 🏆 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!

[Trigger] Making multiboard visible to a certain player

Status
Not open for further replies.
Level 3
Joined
Apr 18, 2018
Messages
58
I created a multiboard with 10 columns and 3 rows.

1) Is it possible to make everything in row 2 visible only for let's say PlayerOne and row 3 visible for another PlayerTwo (whatever colors they have)?

  • Multiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 10 columns and 3 rows, titled Game Statistics .
      • Set VariableSet GameStatistics = (Last created multiboard)
      • Multiboard - Change the color of the title for GameStatistics to (47.10%, 31.80%, 66.30%) with 30.00% transparency
      • Multiboard - Set the text for GameStatistics item in column 1, row 1 to |cff6f2583Player|r
      • Multiboard - Set the icon for GameStatistics item in column 1, row 1 to ReplaceableTextures\WorldEditUI\StartingLocation.blp
      • Multiboard - Set the text for GameStatistics item in column 2, row 1 to |cff6f2583Kills|r
      • Multiboard - Set the icon for GameStatistics item in column 2, row 1 to ReplaceableTextures\WorldEditUI\Editor-Force.blp
      • Multiboard - Set the icon for GameStatistics item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNGlove.blp
      • Multiboard - Set the icon for GameStatistics item in column 4, row 1 to ReplaceableTextures\CommandButtons\BTNRingSkull.blp
      • Multiboard - Set the icon for GameStatistics item in column 5, row 1 to ReplaceableTextures\CommandButtons\BTNSobiMask.blp
      • Multiboard - Set the icon for GameStatistics item in column 6, row 1 to ReplaceableTextures\CommandButtons\BTNBootsOfSpeed.blp
      • Multiboard - Set the icon for GameStatistics item in column 7, row 1 to ReplaceableTextures\CommandButtons\BTNRingGreen.blp
      • Multiboard - Set the icon for GameStatistics item in column 8, row 1 to ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp
      • Multiboard - Set the icon for GameStatistics item in column 9, row 1 to ReplaceableTextures\CommandButtons\BTNMaskOfDeath.blp
      • Multiboard - Set the icon for GameStatistics item in column 10, row 1 to ReplaceableTextures\CommandButtons\BTNBash.blp
      • Multiboard - Set the width for GameStatistics item in column 1, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 2, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 3, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 4, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 5, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 6, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 7, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 8, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 9, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 10, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 1, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 2, row 2 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 3, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 3, row 2 to ((String(AttackSpeed_Stacks[PlayerNumber])) + (/ + MaxAttackSpeedLvl))
      • Multiboard - Set the width for GameStatistics item in column 4, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 4, row 2 to (String(HealthRegenStacks[PlayerNumberLRPU]))
      • Multiboard - Set the width for GameStatistics item in column 5, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 5, row 2 to (String(ManaRegeneration_Stacks[PlayerNumberMRPU]))
      • Multiboard - Set the width for GameStatistics item in column 6, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 6, row 2 to (String(MovementSpeed_Stacks[PlayerNumberMSPU]))
      • Multiboard - Set the width for GameStatistics item in column 7, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 7, row 2 to (String(Armor_Stacks[PlayerNumber_APU]))
      • Multiboard - Set the width for GameStatistics item in column 8, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 8, row 2 to (String(CriticalChance_Stacks[PlayerNumberCSC]))
      • Multiboard - Set the width for GameStatistics item in column 9, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 9, row 2 to (String(LifeSteal_Stacks[PlayerNumberLSPU]))
      • Multiboard - Set the width for GameStatistics item in column 10, row 2 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 10, row 2 to (String(Bash_Stacks[PlayerNumberBPU]))
      • Multiboard - Set the width for GameStatistics item in column 1, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 2, row 3 to 6.00% of the total screen width
      • Multiboard - Set the width for GameStatistics item in column 3, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 3, row 3 to (String(AttackSpeed_Stacks[PlayerNumber]))
      • Multiboard - Set the width for GameStatistics item in column 4, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 4, row 3 to (String(HealthRegenStacks[PlayerNumberLRPU]))
      • Multiboard - Set the width for GameStatistics item in column 5, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 5, row 3 to (String(ManaRegeneration_Stacks[PlayerNumberMRPU]))
      • Multiboard - Set the width for GameStatistics item in column 6, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 6, row 3 to (String(MovementSpeed_Stacks[PlayerNumberMSPU]))
      • Multiboard - Set the width for GameStatistics item in column 7, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 7, row 3 to (String(Armor_Stacks[PlayerNumber_APU]))
      • Multiboard - Set the width for GameStatistics item in column 8, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 8, row 3 to (String(CriticalChance_Stacks[PlayerNumberCSC]))
      • Multiboard - Set the width for GameStatistics item in column 9, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 9, row 3 to (String(LifeSteal_Stacks[PlayerNumberLSPU]))
      • Multiboard - Set the width for GameStatistics item in column 10, row 3 to 6.00% of the total screen width
      • Multiboard - Set the text for GameStatistics item in column 10, row 3 to (String(Bash_Stacks[PlayerNumberBPU]))
      • Multiboard - Set the text for GameStatistics item in column 1, row 2 to (Name of (Triggering player))
      • Multiboard - Set the text for GameStatistics item in column 1, row 3 to (Name of (Triggering player))
      • Multiboard - Show GameStatistics
2) Second question. I need to make dedicate row 2 to PlayerOne and row 3 to PlayerTwo. How can I do it? Here is an example of Item

  • Critical Strike Chance
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Critical Strike Chance
    • Actions
      • Set VariableSet Buying_UnitCSC = (Triggering unit)
      • Set VariableSet Buying_PlayerCSC = (Owner of Buying_UnitCSC)
      • Set VariableSet PlayerNumberCSC = (Player number of Buying_PlayerCSC)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC) Equal to 0
        • Then - Actions
          • Unit - Add Critical Strike Item (+1%/+2%/+3%...etc) to Buying_UnitCSC
          • Set VariableSet CriticalChance_Stacks[PlayerNumberCSC] = 1
          • Game - Display to (All players matching ((Owner of Buying_UnitCSC) Equal to Buying_PlayerCSC).) the text: (String(CriticalChance_Stacks[PlayerNumberCSC]))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC) Less than 25
            • Then - Actions
              • Set VariableSet CriticalChance_Stacks[PlayerNumberCSC] = (CriticalChance_Stacks[PlayerNumberCSC] + 1)
              • Unit - Set level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC to CriticalChance_Stacks[PlayerNumberCSC]
              • Game - Display to (All players matching ((Owner of Buying_UnitCSC) Equal to Buying_PlayerCSC).) the text: (String(CriticalChance_Stacks[PlayerNumberCSC]))
            • Else - Actions
              • Player - Add (Item: (Item being manipulated)'s Integer Field: Priority ('ipri')) to (Triggering player).Current gold
              • Game - Display to (All players matching ((Owner of Buying_UnitCSC) Equal to Buying_PlayerCSC).) the text: |cffff0000Maximum S...
So I need whatever PlayerOne has purchased in Row 2 and whatever PlayerTwo purchased in Row 3 (I uploaded this Item trigger, because it has variables I use in Multiboard)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
I noticed your "All players matching" text messages are done incorrectly. Instead do "All players matching MATCHING PLAYER equal to Buying_PlayerCSC".

And onto your problem. You might have to create different multiboards for each player and use this method:
GetLocalPlayer() faq
The Multiboard example can be found in that thread under: 10. Show Multiboard, for 1 player only?

It's also possible that you could use this Local Player method to use only 1 Multiboard but change the specific entries for each player:
  • If getlocalplayer = Player 1 then
  • Set the text of multiboard row 2 to String(CriticalStrikeChance_Stacks[1])
  • else
  • Set the text of multiboard row 2 to "empty string"
  • end
I typed this up without using the editor (that's why it looks weird). Anyway, if this works it would show the critical strike chance stacks for Player 1 in row 2 but show nothing for everyone else.

A word of warning, this might cause desyncs (crash the game) online.
 
Level 3
Joined
Apr 18, 2018
Messages
58
I noticed your "All players matching" text messages are done incorrectly. Instead do "All players matching MATCHING PLAYER equal to Buying_PlayerCSC".

And onto your problem. You might have to create different multiboards for each player and use this method:
GetLocalPlayer() faq
The Multiboard example can be found in that thread under: 10. Show Multiboard, for 1 player only?

It's also possible that you could use this Local Player method to use only 1 Multiboard but change the specific entries for each player:
  • If getlocalplayer = Player 1 then
  • Set the text of multiboard row 2 to String(CriticalStrikeChance_Stacks[1])
  • else
  • Set the text of multiboard row 2 to "empty string"
  • end
I typed this up without using the editor (that's why it looks weird). Anyway, if this works it would show the critical strike chance stacks for Player 1 in row 2 but show nothing for everyone else.

A word of warning, this might cause desyncs (crash the game) online.

But in that GetLocalPlayer() I can create different multiboard for different players? If yes, then it will do. I can create two multiboards with Item and Ability data and let's say a leader board for everybody with kills and death.
And thanks for fixing Game text message.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Yeah, the example in that thread shows how to do it.

So you create Player 1's Multiboard, then check if GetLocalPlayer equal to Player 1, then Show last created multiboard. This way it only Shows the multiboard for player 1.
 
Level 3
Joined
Apr 18, 2018
Messages
58
Yeah, the example in that thread shows how to do it.

So you create Player 1's Multiboard, then check if GetLocalPlayer equal to Player 1, then Show last created multiboard. This way it only Shows the multiboard for player 1.

I can use event Elapsed time, like I did before, right?

Then I create multiboard, like I did
And Set "Player" Variable (type player) = Triggering player? Or do I have to use something else if I have Elapsed Time Event?
Then I use custom script: Custom script: if GetLocalPlayer() == udg_Player then actions... etc
endif

And btw Player name does not work in my Multiboard. It does not show Name of The player who is playing the game. like WorldEditor and another player for example.
I did it like this in my board Player --> Name of (Triggering Player)
 
Level 3
Joined
Apr 18, 2018
Messages
58
Yeah, the example in that thread shows how to do it.

So you create Player 1's Multiboard, then check if GetLocalPlayer equal to Player 1, then Show last created multiboard. This way it only Shows the multiboard for player 1.

And by the way if you take a look at Multiboard I posted here, I have the same Player_Number variables, meaning if Player 1 acquires an item multiboard will show it. But what happens if Player 2 will acquire the same item, it will override Multiboard entry and will change to Player 2 value of a certain item. How to fix that?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Triggering Player is used in response to an Event that references a Player in some way.

So some examples:
"Player 1 types a chat message "hello" <-- Triggering Player = Player 1.
"A unit dies" <-- Triggering Player = Owner of dying unit.
"A unit starts the effect of an ability <-- Triggering Player = Owner of casting unit.

But if you use an Event like "Elapsed Game Time 1.00 Second", there will be no Triggering Player because that Event has nothing do with Players. If a Player isn't involved in the Event then Triggering Player won't be equal to anything.

Instead, you want to do something like "Set variable Player = Player 1" or "Pick every player in All Players" in response to the "Elapsed Game Time" Event.

So for your Multiboard trigger:
Pick every player in All players, set PlayerNumber equal to the player number of picked player, then create the Multiboard for that picked player. Finally, use GetLocalPlayer() to Show the Multiboard to your picked player.

  • Create Multiboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet Player = (Picked player)
          • Set VariableSet PlayerNumber = (Player number of Player)
          • -------- --------
          • -------- Create Multiboard for Picked Player --------
          • Multiboard - Create a multiboard with 1 columns and 1 rows, titled New Multiboard.
          • Set VariableSet Multiboard[PlayerNumber] = (Last created multiboard)
          • -------- --------
          • -------- Show the Multiboard to Picked Player --------
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Multiboard - Show (Last created multiboard)
          • Custom script: endif
  • Update Multiboard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set VariableSet Player = (Owner of (Hero manipulating item))
      • Set VariableSet PlayerNumber = (Player number of Player)
      • Multiboard - Set the text for Multiboard[PlayerNumber] item in column 1, row 2 to Name of your item!
 
Last edited:
Level 3
Joined
Apr 18, 2018
Messages
58
Triggering Player is used in response to an Event that references a Player in some way.

So some examples:
"Player 1 types a chat message "hello" <-- Triggering Player = Player 1.
"A unit dies" <-- Triggering Player = Owner of dying unit.
"A unit starts the effect of an ability <-- Triggering Player = Owner of casting unit.

But if you use an Event like "Elapsed Game Time 1.00 Second", there will be no Triggering Player because that Event has nothing do with Players. If a Player isn't involved in the Event then Triggering Player won't be equal to anything.

Instead, you want to do something like "Set variable Player = Player 1" or "Pick every player in All Players" in response to the "Elapsed Game Time" Event.

So for your Multiboard trigger:
Pick every player in All players, set PlayerNumber equal to the player number of picked player, then create the Multiboard for that picked player. Finally, use GetLocalPlayer() to Show the Multiboard to your picked player.

  • Create Multiboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet Player = (Picked player)
          • Set VariableSet PlayerNumber = (Player number of Player)
          • -------- --------
          • -------- Create Multiboard for Picked Player --------
          • Multiboard - Create a multiboard with 1 columns and 1 rows, titled New Multiboard.
          • Set VariableSet Multiboard[PlayerNumber] = (Last created multiboard)
          • -------- --------
          • -------- Show the Multiboard to Picked Player --------
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Multiboard - Show (Last created multiboard)
          • Custom script: endif
  • Update Multiboard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set VariableSet Player = (Owner of (Hero manipulating item))
      • Set VariableSet PlayerNumber = (Player number of Player)
      • Multiboard - Set the text for Multiboard[PlayerNumber] item in column 1, row 2 to Name of your item!

Do I need to set two different variables PlayerNumber and Player or it is the same variable in both triggers?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
They're the same variables. It's safe to do this as long as you don't do something like this with those variables:
  • Example of what not to do
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set Variable Player = (Owner of (Triggering unit))
      • Wait 5.00 seconds
      • Game - Display to (All players) for 30.00 seconds the text: (Name of Player + has gained a level)
Because in this Example there's a chance that Player is changed during this 5.00 second Wait. So you might end up with a completely different Player.

But that's just an example of what not to do. As long as you reference Player/PlayerNumber in the same trigger without using Waits you should be fine.
 
Last edited:
Level 3
Joined
Apr 18, 2018
Messages
58
  • Update Multiboard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set VariableSet Player = (Owner of (Hero manipulating item))
      • Set VariableSet PlayerNumber = (Player number of Player)
      • Multiboard - Set the text for Multiboard[PlayerNumber] item in column 1, row 2 to Name of your item!

And what if Item being purchased is let's say Tome of Agility. And I need to set a text in Multiboard that would be equal to the amount of times Tome of Agility is bought. How do I make it work for different players? So Multiboard entry would not re-written?

Because I believe if I would do following:
Set Variable AmoutOfTimes[PlayerNumber] = (AmountOfTimes[PlayerNumber] +1)
It would be messed up again, right? So how do I manage this?

Because so far I have an Item that gives hero ability to Critical Chance (and there are levels)
  • Critical Strike Chance
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Critical Strike Chance
    • Actions
      • Set VariableSet Buying_UnitCSC = (Triggering unit)
      • Set VariableSet Buying_PlayerCSC = (Owner of Buying_UnitCSC)
      • Set VariableSet PlayerNumberCSC = (Player number of Buying_PlayerCSC)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC) Equal to 0
        • Then - Actions
          • Unit - Add Critical Strike Item (+1%/+2%/+3%...etc) to Buying_UnitCSC
          • Set VariableSet CriticalChance_Stacks[PlayerNumberCSC] = 1
          • Game - Display to (All players matching ((Matching player) Equal to Buying_PlayerCSC).) the text: (String(CriticalChance_Stacks[PlayerNumberCSC]))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC) Less than 25
            • Then - Actions
              • Set VariableSet CriticalChance_Stacks[PlayerNumberCSC] = (CriticalChance_Stacks[PlayerNumberCSC] + 1)
              • Unit - Set level of Critical Strike Item (+1%/+2%/+3%...etc) for Buying_UnitCSC to CriticalChance_Stacks[PlayerNumberCSC]
              • Game - Display to (All players matching ((Matching player) Equal to Buying_PlayerCSC).) the text: (String(CriticalChance_Stacks[PlayerNumberCSC]))
            • Else - Actions
              • Player - Add (Item: (Item being manipulated)'s Integer Field: Priority ('ipri')) to (Triggering player).Current gold
              • Game - Display to (All players matching ((Matching player) Equal to Buying_PlayerCSC).) the text: |cffff0000Maximum S...
And then I use CriticalChance_Stacks variable in my Multiboard like this:
  • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ((String(CriticalChance_Stacks[PlayerNumberCSC])) + (/ + MaxCSCLvl))
And it works just fine, until another player buys the same item, then entry in my multiboard changes to value of another player. If I buy it again, it changes back to mine. That's the main thing I am struggling with
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Did you create a Multiboard for each player? Each player should have their own Multiboard that uses their Player Number as the Index.

Multiboard[1] = Player 1s
Multiboard[2] = Players 2s
etc...

So you should only be changing the value for 1 specific multiboard.

Could you post your trigger that creates the Multiboards please?
 
Level 3
Joined
Apr 18, 2018
Messages
58
Did you create a Multiboard for each player? Each player should have their own Multiboard that uses their Player Number as the Index.

Multiboard[1] = Player 1s
Multiboard[2] = Players 2s
etc...

So you should only be changing the value for 1 specific multiboard.

Could you post your trigger that creates the Multiboards please?
So far I have this, for now only one Multiboard. I mean, even if I create two different ones, won't still value be changing when other player acquires the same item, since the variable is global.
  • Multiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PlayerMultiboard = (Picked player)
          • Set VariableSet PlayerNumberMultiboard = (Player number of PlayerMultiboard)
          • Multiboard - Create a multiboard with 10 columns and 1 rows, titled Game Statistics .
          • Set VariableSet GameStatistics[PlayerNumberMultiboard] = (Last created multiboard)
          • Multiboard - Change the color of the title for GameStatistics[PlayerNumberMultiboard] to (47.10%, 31.80%, 66.30%) with 80.00% transparency
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to |cff6f2583Player|r
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to ReplaceableTextures\WorldEditUI\StartingLocation.blp
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to |cff6f2583Kills|r
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to ReplaceableTextures\WorldEditUI\Editor-Force.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNGlove.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to ReplaceableTextures\CommandButtons\BTNRingSkull.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to ReplaceableTextures\CommandButtons\BTNSobiMask.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to ReplaceableTextures\CommandButtons\BTNBootsOfSpeed.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to ReplaceableTextures\CommandButtons\BTNRingGreen.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to ReplaceableTextures\CommandButtons\BTNMaskOfDeath.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to ReplaceableTextures\CommandButtons\BTNBash.blp
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to 8.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to 6.00% of the total screen width
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to ((String(AttackSpeed_Stacks[PlayerNumber])) + (/ + MaxAttackSpeedLvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to ((String(HealthRegenStacks[PlayerNumberLRPU])) + (/ + MaxLRPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to ((String(ManaRegeneration_Stacks[PlayerNumberMRPU])) + (/ + MaxMRPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to ((String(MovementSpeed_Stacks[PlayerNumberMSPU])) + (/ + MaxMSPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to ((String(Armor_Stacks[PlayerNumber_APU])) + (/ + MaxAPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ((String(CriticalChance_Stacks[PlayerNumberCSC])) + (/ + MaxCSCLvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to ((String(LifeSteal_Stacks[PlayerNumberLSPU])) + (/ + MaxLSPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to ((String(Bash_Stacks[PlayerNumberBPU])) + (/ + MaxBPULvl))
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Multiboard - Show (Last created multiboard)
          • Custom script: endif
          • Multiboard - Maximize (Last created multiboard)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Arrays create multiple versions of a variable. That's why we're putting the Player Number inside of the Index [#], so each Player has their own version of the variable.

Think about what's happening in this trigger. We loop through every single player, setting the variables Player = picked player, and PlayerNumber = picked player's number.

So when it reaches Player 1:
Player = Player 1
PlayerNumber = 1
Multiboard[PlayerNumber] = A newly created multiboard

When it reaches Player 2:
Player = Player 2
PlayerNumber = 2
Multiboard[PlayerNumber] = A newly created multiboard

So Multiboard[1] = The multiboard created for Player 1 and Multiboard[2] = The multiboard created for Player 2.

And I see why it's not working. You changed the names of the variables.

See how the custom script at the bottom says:
  • Custom script: if GetLocalPlayer() == udg_Player then
udg_Player no longer exists because you renamed it to PlayerMultiboard. So change that to "udg_PlayerMultiboard" and it should work.
  • Custom script: if GetLocalPlayer() == udg_PlayerMultiboard then
 
Last edited:
Level 3
Joined
Apr 18, 2018
Messages
58
Arrays create multiple versions of a variable. That's why we're putting the Player Number inside of the Index [#], so each Player has their own version of the variable.

Think about what's happening in this trigger. We loop through every single player, setting the variables Player = picked player, and PlayerNumber = picked player's number.

So when it reaches Player 1:
Player = Player 1
PlayerNumber = 1
Multiboard[PlayerNumber] = A newly created multiboard

When it reaches Player 2:
Player = Player 2
PlayerNumber = 2
Multiboard[PlayerNumber] = A newly created multiboard

So Multiboard[1] = The multiboard created for Player 1 and Multiboard[2] = The multiboard created for Player 2.

And I see why it's not working. You changed the names of the variables.

See how the custom script at the bottom says:
  • Custom script: if GetLocalPlayer() == udg_Player then
udg_Player no longer exists because you renamed it to PlayerMultiboard. So change that to "udg_PlayerMultiboard" and it should work.
  • Custom script: if GetLocalPlayer() == udg_PlayerMultiboard then

So basically, if I change custom script Player to my variable PlayerMultiboard (totally missed it), then each player will have their own multiboard and this line in trigger will stop interfering between players?
  • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ((String(CriticalChance_Stacks[PlayerNumberCSC])) + (/ + MaxCSCLvl))
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
I actually can't say for certain if this will fix everything, but it's definitely one error that needs fixing.

I'm just confused as to how you could even see any Multiboard to begin with when that line of code wasn't working properly.

Maybe it has something to do with "Maximize last created multiboard". I'm going to try and test this out.

EDIT: OKAY, I was under the impression that Multiboards were hidden by default but it turns out they are not. This makes a lot more sense now.

After fixing that udg_Player issue, add a new Action to the trigger:
  • Multiboard - Hide (Last created multiboard)
Put that Action right below "Create a multiboard", this way the Multiboard is hidden for All Players by default.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Alright, after further testing I found some weird problems but managed to fix them.

Update your trigger to work like this. You don't have to change the Variable names, just structure the trigger so that you Show the Multiboards in a separate "Pick every Player" loop:
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 0.25 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet P = (Picked player)
          • Set VariableSet PN = (Player number of P)
          • Multiboard - Create a multiboard with 1 columns and 1 rows, titled (Name of P).
          • Set VariableSet MB[PN] = (Last created multiboard)
          • Multiboard - Hide (Last created multiboard)
          • -------- Put all of your multiboard column/row stuff here --------
          • -------- Put all of your multiboard column/row stuff here --------
          • -------- Put all of your multiboard column/row stuff here --------
          • -------- Put all of your multiboard column/row stuff here --------
          • -------- Put all of your multiboard column/row stuff here --------
      • -------- --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet P = (Picked player)
          • Set VariableSet PN = (Player number of P)
          • Custom script: if GetLocalPlayer() == udg_P then
          • Multiboard - Show MB[PN]
          • Custom script: endif
When you Show the Multiboard inside GetLocalPlayer() make sure to use the Variable and not "last created multiboard".
 

Attachments

  • Multiboard Example.w3m
    16.9 KB · Views: 21
Level 3
Joined
Apr 18, 2018
Messages
58
I actually can't say for certain if this will fix everything, but it's definitely one error that needs fixing.

I'm just confused as to how you could even see any Multiboard to begin with when that line of code wasn't working properly.

Maybe it has something to do with "Maximize last created multiboard". I'm going to try and test this out.

EDIT: OKAY, I was under the impression that Multiboards were hidden by default but it turns out they are not. This makes a lot more sense now.

After fixing that udg_Player issue, add a new Action to the trigger:
  • Multiboard - Hide (Last created multiboard)
Put that Action right below "Create a multiboard", this way the Multiboard is hidden for All Players by default.

I just tried a map with my friend Something is not right. Multiboard is shown for one player and not even player 1. Maybe I could upload a map, so you could check?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Fixed it.

The issues:
1) You were using the Periodic Timer Event, meaning you were creating a new multiboard for each player every 1.00 second. You want to use the Elapsed Game Time Event instead.
  • Time - Elapsed game time is 0.25 seconds
2) You put the second Pick Every Player action INSIDE of the first one instead of below it.
  • Multiboard
    • Events
      • Time - Elapsed game time is 0.25 seconds
    • Conditions
    • Actions
      • -------- Create the Multiboards --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PlayerMultiboard = (Picked player)
          • Set VariableSet PlayerNumberMultiboard = (Player number of PlayerMultiboard)
          • Multiboard - Create a multiboard with 10 columns and 1 rows, titled Game Statistics .
          • Set VariableSet GameStatistics[PlayerNumberMultiboard] = (Last created multiboard)
          • Multiboard - Change the color of the title for GameStatistics[PlayerNumberMultiboard] to (47.10%, 31.80%, 66.30%) with 80.00% transparency
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to |cff6f2583Player|r
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to ReplaceableTextures\WorldEditUI\StartingLocation.blp
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to |cff6f2583Kills|r
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to ReplaceableTextures\WorldEditUI\Editor-Force.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNGlove.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to ReplaceableTextures\CommandButtons\BTNRingSkull.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to ReplaceableTextures\CommandButtons\BTNSobiMask.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to ReplaceableTextures\CommandButtons\BTNBootsOfSpeed.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to ReplaceableTextures\CommandButtons\BTNRingGreen.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to ReplaceableTextures\CommandButtons\BTNMaskOfDeath.blp
          • Multiboard - Set the icon for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to ReplaceableTextures\CommandButtons\BTNBash.blp
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 1, row 1 to 8.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 2, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to 6.00% of the total screen width
          • Multiboard - Set the width for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to 6.00% of the total screen width
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 3, row 1 to ((String(AttackSpeed_Stacks[PlayerNumber])) + (/ + MaxAttackSpeedLvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 4, row 1 to ((String(HealthRegenStacks[PlayerNumberLRPU])) + (/ + MaxLRPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 5, row 1 to ((String(ManaRegeneration_Stacks[PlayerNumberMRPU])) + (/ + MaxMRPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 6, row 1 to ((String(MovementSpeed_Stacks[PlayerNumberMSPU])) + (/ + MaxMSPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 7, row 1 to ((String(Armor_Stacks[PlayerNumber_APU])) + (/ + MaxAPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 8, row 1 to ((String(CriticalChance_Stacks[PlayerNumberCSC])) + (/ + MaxCSCLvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 9, row 1 to ((String(LifeSteal_Stacks[PlayerNumberLSPU])) + (/ + MaxLSPULvl))
          • Multiboard - Set the text for GameStatistics[PlayerNumberMultiboard] item in column 10, row 1 to ((String(Bash_Stacks[PlayerNumberBPU])) + (/ + MaxBPULvl))
          • Multiboard - Hide (Last created multiboard)
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- Show the Multiboards --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PlayerMultiboard = (Picked player)
          • Set VariableSet PlayerNumberMultiboard = (Player number of PlayerMultiboard)
          • Custom script: if GetLocalPlayer() == udg_PlayerMultiboard then
          • Multiboard - Show GameStatistics[PlayerNumberMultiboard]
          • Custom script: endif
          • Multiboard - Maximize GameStatistics[PlayerNumberMultiboard]

3) You were using "last created multiboard" in the 2nd Pick Every Player action instead of:
  • GameStatistics[PlayerNumberMultiboard]
You cannot do this because the last created multiboard will be wrong.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Hey, I found some more issues in your map and I went through and fixed all of them.

I also deleted all of your unnecessary variables. You really only need 1 Variable of each type in a lot of cases.

Try to keep using Unit/Player/PlayerNumber throughout your triggers when possible instead of creating new variables. Use what I did as an example.
 

Attachments

  • Commander Arena Fixed 2.w3m
    66 KB · Views: 18
Level 3
Joined
Apr 18, 2018
Messages
58
Hey, I found some more issues in your map and I went through and fixed all of them.

I also deleted all of your unnecessary variables. You really only need 1 Variable of each type in a lot of cases.

Try to keep using Unit/Player/PlayerNumber throughout your triggers when possible instead of creating new variables. Use what I did as an example.

Howdy, wow, thanks... So all this time I was creating many different variables, when basically I could use the same Player and Player Number? Hot damn.

And and, multiboards work fine? I mean, values updated into multiboard do not get overwritten if another player buys the same item? Each player is displayed his own Item ability level?
 
Level 3
Joined
Apr 18, 2018
Messages
58
I can't say for certain as I can only test it in singleplayer, but I can't see why it wouldn't work.

And no problem.

I do have a lot to learn, but also have some time with all that quarantine going on. For now I am done with items, will have to move on to spells. I mean GUI spells are for sure fun, but if I want to change effects and knock ups I have to learn vJass and Jass, right? How complicated it is?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
Well, there's GUI friendly systems for Knockback/Knock Up stuff and honestly you can make really complex spells in GUI if you know what you're doing.

But yeah, Jass is the next step. Although, I would recommend learning Lua instead of Jass as it's MUCH better.
 
Level 3
Joined
Apr 18, 2018
Messages
58
Well, there's GUI friendly systems for Knockback/Knock Up stuff and honestly you can make really complex spells in GUI if you know what you're doing.

But yeah, Jass is the next step. Although, I would recommend learning Lua instead of Jass as it's MUCH better.

And what is the difference between Lua and Jass ?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,582
They're actually very similar in the way they work in regards to the API JASS Manual: API Browser - API Browser: Types

But there's subtle differences in syntax such as:
vJass:
vJASS:
call KillUnit(GetTriggerUnit())
Lua:
Lua:
KillUnit(GetTriggerUnit())
So Lua doesn't require you to type "call" before you run a function like KillUnit. Also, Lua also doesn't require you to null (nil in Lua) local variables. These are small things I know but the list goes on and on.

I find it to be much cleaner, easier to read, and overall just easier to use than vJass. I'm pretty sure it's just objectively better in almost all aspects when compared to vJass, which would make sense seeing as how old Jass is and how Lua is the "new" language that was introduced in patch 1.31. The only issue is the lack of debugging support but that's about it.
 
Last edited:
Level 3
Joined
Apr 18, 2018
Messages
58
They're actually very similar in the way they work in regards to the API JASS Manual: API Browser - API Browser: Types

But there's subtle differences in syntax such as:
vJass:
vJASS:
call KillUnit(GetTriggerUnit())
Lua:
Lua:
KillUnit(GetTriggerUnit())
So Lua doesn't require you to type "call" before you run a function like KillUnit. Also, Lua also doesn't require you to null (nil in Lua) local variables. These are small things I know but the list goes on and on.

I find it to be much cleaner, easier to read, and overall just easier to use than vJass. I'm pretty sure it's just objectively better in almost all aspects when compared to vJass, which would make sense seeing as how old Jass is and how Lua is the "new" language that was introduced in patch 1.31. The only issue is the lack of debugging support but that's about it.

Do they also have it in Reforged? I mean Lua
 
Status
Not open for further replies.
Top