• 🏆 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] Multiboard Crashes game (Requires math)

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
Let me explain some things:
1- The team 1 is 1,3,5,7,9,11 players
2- The team 2 is 2,4,6,8,10,12 players

  • Multiboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Player_Count_team1 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))))
      • Set Player_Count_team2 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 2 (Blue)) Equal to True)))))
      • Multiboard - Create a multiboard with 5 columns and (5 + (Player_Count_team1 + Player_Count_team2)) rows, titled Anime Brawl
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (|cffff0000 + (Kill_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (|cff0000ff + (Death_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to (|CFF949694 + (Assist_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Team 1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Team 2
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 5, row 0 to 2.00% of the total screen width
      • For each (Integer A) from Player_Count_team1 to (1 + Player_Count_team1), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team1 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 2) to (Player_Colors[(2 x ((Integer A) - 1))] + ((Name of (Player((2 x ((Integer A) - 1))))) + |r))
            • Else - Actions
      • For each (Integer B) from Player_Count_team2 to (1 + Player_Count_team2), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team2 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row (4 + Player_Count_team1) to (Player_Colors[((Integer B) x 2)] + ((Name of (Player(((Integer B) x 2)))) + |r))
            • Else - Actions
      • Multiboard - Show (Last created multiboard)
The multiboard is to look like:

PlayerName Revive Kills Deaths Assist
Team 1
Player 1
Player 3
Player 5
Player 7
Player 9
Player 11
Team 2
Player 2
Player 4
Player 6
Player 8
Player 10
Player 12
Time Elapsed
Game Mode
 
Level 5
Joined
Oct 27, 2007
Messages
158
Let me explain some things:
1- The team 1 is 1,3,5,7,9,11 players
2- The team 2 is 2,4,6,8,10,12 players

  • Multiboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Player_Count_team1 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))))
      • Set Player_Count_team2 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 2 (Blue)) Equal to True)))))
      • Multiboard - Create a multiboard with 5 columns and (5 + (Player_Count_team1 + Player_Count_team2)) rows, titled Anime Brawl
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (|cffff0000 + (Kill_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (|cff0000ff + (Death_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to (|CFF949694 + (Assist_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Team 1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Team 2
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 5, row 0 to 2.00% of the total screen width
      • For each (Integer A) from 1 to Player_Count_team1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team1 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 2) to (Player_Colors[(2 x ((Integer A) - 1))] + ((Name of (Player((2 x ((Integer A) - 1))))) + |r))
            • Else - Actions
      • For each (Integer B) from 1 to Player_Count_team2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team2 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer B) + 3 + Player_Count_team1) to (Player_Colors[((Integer B) x 2) - 1] + ((Name of (Player(((Integer B) x 2) - 1))) + |r))
            • Else - Actions
      • Multiboard - Show (Last created multiboard)
The multiboard is to look like:

PlayerName Revive Kills Deaths Assist
Team 1
Player 1
Player 3
Player 5
Player 7
Player 9
Player 11
Team 2
Player 2
Player 4
Player 6
Player 8
Player 10
Player 12
Time Elapsed
Game Mode


call Player(does_not_exist) = crash

I've changed the player color, player indexing and the loop begin-end values. The way you've set it up, causes a player call to an invalid player.

To index players 1, 3, 5, 7, 9, 11 you have to use ((Integer A - 1) * 2)
To index players 2, 4, 6, 8, 10, 12 you have to use ((Integer B * 2) - 1)

Integer A from 1 to Player_Count_team1 (1 to 6 included)
Integer B from 1 to Player_Count_team2 (1 to 6 included)

The row to start filling the names of team1 players is Integer A + 2 (starts at 3)
The row to start filling the names of team2 players is 3 + Integer B + Player_Count_team1 (starts at 10)
 
Level 12
Joined
Mar 23, 2008
Messages
942
  • Multiboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Player_Count_team1 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))))
      • Set Player_Count_team2 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 2 (Blue)) Equal to True)))))
      • Multiboard - Create a multiboard with 5 columns and (5 + (Player_Count_team1 + Player_Count_team2)) rows, titled Anime Brawl
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (|cffff0000 + (Kill_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (|cff0000ff + (Death_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to (|CFF949694 + (Assist_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Team 1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Team 2
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 5, row 0 to 2.00% of the total screen width
      • For each (Integer A) from 1 to Player_Count_team1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team1 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 2) to (Player_Colors[(2 x ((Integer A) - 1))] + ((Name of (Player((2 x ((Integer A) - 1))))) + |r))
            • Else - Actions
      • For each (Integer B) from 1 to Player_Count_team2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team2 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer B) + (3 + Player_Count_team1)) to (Player_Colors[(((Integer B) x 2) - 1)] + ((Name of (Player((((Integer B) x 2) - 1)))) + |r))
            • Else - Actions
      • Multiboard - Show (Last created multiboard)
Keep crashing :(
And... that way you set, will not make team 2 looks equal team 1? ((2x integer) - 1)
 
Level 5
Joined
Oct 27, 2007
Messages
158
Keep crashing :(
And... that way you set, will not make team 2 looks equal team 1? ((2x integer) - 1)


No.. I've entered the calculations for each team. Just look at the calculations I've just entered.
 
Level 5
Joined
Oct 27, 2007
Messages
158
But keep crashing >.<

1. When does it crash?
2. Does it crash when you disable the trigger completely?


From what I've seen I can't find a reason why it would crash with the calculations I've made.
 
Level 12
Joined
Mar 23, 2008
Messages
942
its the same I posted above your post:

  • Multiboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Player_Count_team1 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))))
      • Set Player_Count_team2 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 2 (Blue)) Equal to True)))))
      • Multiboard - Create a multiboard with 5 columns and (5 + (Player_Count_team1 + Player_Count_team2)) rows, titled Anime Brawl
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (|cffff0000 + (Kill_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (|cff0000ff + (Death_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to (|CFF949694 + (Assist_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Team 1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Team 2
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 5, row 0 to 2.00% of the total screen width
      • For each (Integer A) from 1 to Player_Count_team1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team1 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 2) to (Player_Colors[(2 x ((Integer A) - 1))] + ((Name of (Player((2 x ((Integer A) - 1))))) + |r))
            • Else - Actions
      • For each (Integer B) from 1 to Player_Count_team2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team2 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer B) + (3 + Player_Count_team1)) to (Player_Colors[(((Integer B) x 2) - 1)] + ((Name of (Player((((Integer B) x 2) - 1)))) + |r))
            • Else - Actions
      • Multiboard - Show (Last created multiboard)
 
Level 5
Joined
Oct 27, 2007
Messages
158
its the same I posted above your post:

  • Multiboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Player_Count_team1 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))))
      • Set Player_Count_team2 = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of Player 2 (Blue)) Equal to True)))))
      • Multiboard - Create a multiboard with 5 columns and (5 + (Player_Count_team1 + Player_Count_team2)) rows, titled Anime Brawl
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (|cffff0000 + (Kill_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (|cff0000ff + (Death_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to (|CFF949694 + (Assist_Name + |r))
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Team 1
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Team 2
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (3 + Player_Count_team1) to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 4, row 0 to 2.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 5, row 0 to 2.00% of the total screen width
      • For each (Integer A) from 1 to Player_Count_team1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team1 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 2) to (Player_Colors[(2 x ((Integer A) - 1))] + ((Name of (Player((2 x ((Integer A) - 1))))) + |r))
            • Else - Actions
      • For each (Integer B) from 1 to Player_Count_team2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Count_team2 Greater than or equal to 1
            • Then - Actions
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer B) + (3 + Player_Count_team1)) to (Player_Colors[(((Integer B) x 2) - 1)] + ((Name of (Player((((Integer B) x 2) - 1)))) + |r))
            • Else - Actions
      • Multiboard - Show (Last created multiboard)


I still see nothing wrong with the indexing. All players and colors are indexed correctly. How did you setup the player_color array?

Consider uploading the map so I can examine it more closely.
 
Level 5
Joined
Oct 27, 2007
Messages
158
For the record......

Having converted the trigger to Jass I noticed it uses ConvertedPlayer to subtract 1 from the player index. So using an index that's already 0 will fail miserably. Pretty bad to assume someone will unconditionally not use index 0. 0 is a number like any other and should be used. The function should check for this. Another fine example why the GUI sucks so bad.

If you have to use GUI then proper indexing for getting the player name by index would be.

For players 1, 3, 5, 7, 9, 11 you have to use ((Integer A - 1) * 2) + 1 simplifies to (2 * Integer A) - 1
For players 2, 4, 6, 8, 10, 12 you have to use ((Integer B * 2) - 1) + 1 simplifies to (2 * Integer B)
 
Last edited:
Status
Not open for further replies.
Top