• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

So confused with Multiboard

Status
Not open for further replies.
Level 8
Joined
Sep 9, 2007
Messages
114
In my current Map i'm struggling with a Multiboard

Creating the multiboard is the easy part... But creating the values etc... is where i'm failing.

Info:
There are 4 teams
Every team can spawn up to 100 hero type units
Each unit can level up

What is wrong with this trigger:
  • Events
  • Time - Every 0.50 seconds of game time
  • Conditions
  • Actions
  • Unit Group - Pick every unit in Your_Heroes and do (Actions)
  • Loop - Actions
  • Multiboard - Set the icon for Income_Multiboard item in column 1, row 1 to ReplaceableTextures\TeamColor\TeamColor00.blp
  • Multiboard - Set the text for Income_Multiboard item in column 1, row 1 to Player Red:
  • Multiboard - Set the width for Income_Multiboard item in column 1, row 1 to 10.00% of the total screen width
  • Multiboard - Set the icon for Income_Multiboard item in column 1, row 2 to ReplaceableTextures\TeamColor\TeamColor01.blp
  • Multiboard - Set the text for Income_Multiboard item in column 1, row 2 to Player Blue:
  • Multiboard - Set the width for Income_Multiboard item in column 1, row 2 to 10.00% of the total screen width
  • Multiboard - Set the icon for Income_Multiboard item in column 1, row 3 to ReplaceableTextures\TeamColor\TeamColor02.blp
  • Multiboard - Set the text for Income_Multiboard item in column 1, row 3 to Player Teal:
  • Multiboard - Set the width for Income_Multiboard item in column 1, row 3 to 10.00% of the total screen width
  • Multiboard - Set the icon for Income_Multiboard item in column 1, row 4 to ReplaceableTextures\TeamColor\TeamColor03.blp
  • Multiboard - Set the text for Income_Multiboard item in column 1, row 4 to Player Purple:
  • Multiboard - Set the width for Income_Multiboard item in column 1, row 4 to 10.00% of the total screen width
  • Multiboard - Set the text for Income_Multiboard item in column 2, row 1 to (String((2 x (Hero level of (Picked unit)))))
  • Multiboard - Set the icon for Income_Multiboard item in column 2, row 1 to UI\Feedback\Resources\ResourceGold.blp
  • Multiboard - Set the width for Income_Multiboard item in column 2, row 1 to 5.00% of the total screen width
  • Multiboard - Set the text for Income_Multiboard item in column 2, row 2 to (String((2 x (Hero level of (Picked unit)))))
  • Multiboard - Set the icon for Income_Multiboard item in column 2, row 2 to UI\Feedback\Resources\ResourceGold.blp
  • Multiboard - Set the width for Income_Multiboard item in column 2, row 2 to 5.00% of the total screen width
  • Multiboard - Set the text for Income_Multiboard item in column 2, row 3 to (String((2 x (Hero level of (Picked unit)))))
  • Multiboard - Set the icon for Income_Multiboard item in column 2, row 3 to UI\Feedback\Resources\ResourceGold.blp
  • Multiboard - Set the width for Income_Multiboard item in column 2, row 3 to 5.00% of the total screen width
  • Multiboard - Set the text for Income_Multiboard item in column 2, row 4 to (String((2 x (Hero level of (Picked unit)))))
  • Multiboard - Set the icon for Income_Multiboard item in column 2, row 4 to UI\Feedback\Resources\ResourceGold.blp
  • Multiboard - Set the width for Income_Multiboard item in column 2, row 4 to 5.00% of the total screen width
This is another trigger That sets the picked units:
  • Multiple Units Income
  • Events
  • Unit - A unit Finishes training a unit
  • Conditions
  • ((Trained unit) is A Hero) Equal to True
  • Actions
  • Unit Group - Add (Trained unit) to Your_Heroes
Problem is... the picked units are all colliding causing the table to either only register the last trained unit... or register it globally so that every trained unit on the map adds to the leader board

I've been stuck on this issue for awhile now, and i'm finally stumped...
 
Now, I'm guessing my trigger didn't work, then...
I don't think there's a way to add all the hero levels to one variable, but there's probably someone knowing more than me out there, and I sincerely hope they help you out!

BTW: If your problem really is that the multiboard registers all the players hero, replace this trigger:
  • Multiple Units Income
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • ((Trained unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Trained unit) to Your_Heroes
with this:
  • Multiple Units Income
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • ((Trained unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Trained unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Unit Group - Add (Trained unit) to P1_Your_Heroes
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Trained unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Unit Group - Add (Trained unit) to P2_Your_Heroes
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Trained unit)) Equal to Player 3 (Teal)
                • Then - Actions
                  • Unit Group - Add (Trained unit) to P3_Your_Heroes
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Trained unit)) Equal to Player 4 (Purple)
                    • Then - Actions
                      • Unit Group - Add (Trained unit) to P4_Your_Heroes
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Trained unit)) Equal to Player 5 (Yellow)
                        • Then - Actions
                          • Unit Group - Add (Trained unit) to P5_Your_Heroes
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of (Trained unit)) Equal to Player 6 (Orange)
                            • Then - Actions
                              • Unit Group - Add (Trained unit) to P6_Your_Heroes
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Trained unit)) Equal to Player 7 (Green)
                                • Then - Actions
                                  • Unit Group - Add (Trained unit) to P7_Your_Heroes
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Trained unit)) Equal to Player 8 (Pink)
                                    • Then - Actions
                                      • Unit Group - Add (Trained unit) to P8_Your_Heroes
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Owner of (Trained unit)) Equal to Player 9 (Gray)
                                        • Then - Actions
                                          • Unit Group - Add (Trained unit) to P9_Your_Heroes
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Owner of (Trained unit)) Equal to Player 10 (Light Blue)
                                            • Then - Actions
                                              • Unit Group - Add (Trained unit) to P10_Your_Heroes
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Owner of (Trained unit)) Equal to Player 11 (Dark Green)
                                                • Then - Actions
                                                  • Unit Group - Add (Trained unit) to P11_Your_Heroes
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Owner of (Trained unit)) Equal to Player 12 (Brown)
                                                    • Then - Actions
                                                      • Unit Group - Add (Trained unit) to P12_Your_Heroes
                                                    • Else - Actions
Variable:Type:
P1_Your_Heroes[Unit Group]
P2_Your_Heroes[Unit Group]
P3_Your_Heroes[Unit Group]
P4_Your_Heroes[Unit Group]
P5_Your_Heroes[Unit Group]
P6_Your_Heroes[Unit Group]
P7_Your_Heroes[Unit Group]
P8_Your_Heroes[Unit Group]
P9_Your_Heroes[Unit Group]
P10_Your_Heroes[Unit Group]
P11_Your_Heroes[Unit Group]
P12_Your_Heroes[Unit Group]
 
Level 11
Joined
Dec 31, 2007
Messages
780
well... the way arrays work is simple... you use the same variable name and a number between [] to identify the data stored into that variable

for ie: unit[1] could be a footman and unit[2] a grunt...

i would do this:
  • Actions
  • for each integer A from 1 to 12
    • loop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Conditions
      • (Owner of (Trained unit)) Equal to Player[integerA]
    • Then - Actions
      • Unit Group - Add (Trained unit) to Your_Heroes_P[integerA]
    • Else - Actions
you will need to store players (player 1, 2, 3, 4, etc) into a variable array (in this case named Player[number of player] so... Player[1] will be player 1 ( i recomend to store the players variable in map initialization)

this loop actions plus variable array does the same as mephisto did in his trigger... but is more efficient

if you need further help just post your doubts
 
Status
Not open for further replies.
Top