Scoreboard (Dialog) Setup

X-maul

AKA: Demtrod
Reaction score
201
I'm creating a scoreboard with a dialog, for my map. I got 2 teams, and I allow players to move around in the lobby. So my problem is that, I want to store the 4 players on team 1 in the first 4 rows (not actual rows, but lines made in a dialog), and the 4 players on team 2, on the last 4 rows.

Do any of you guys have a good way to do this? (I need to have a way to refer to the players spot for adding kills, deaths and captures).
 

Dave312

Censored for your safe viewing
Reaction score
269
Create a array variable of the type integer which will store the "row" that a player uses in the leaderboard. If you create all your dialog items in arrays, then you can use this row variable as an index to get the correct dialog item you want to modify. You will just need to assign a row number to each player based on which team they are in.
 

X-maul

AKA: Demtrod
Reaction score
201
well, the problem is not how to create the different dialog items for each player, the problem, is that I allow players to move around in the start of the map, which makes it possible for player 1,3,4 and 6 to be on team 1, and player 2, 5, 7 and 8 to be on team 2. And I want the scoreboard to display

1st player on team 1
2nd player on team 1
3rd player on team 1
4th player on team 1
---------
1st player on team 2
2nd player on team 2
3rd player on team 2
4th player on team 2


How would I do this?
 

Phubar

Ultra Cool Member
Reaction score
30
I'm not sure that i have understood the problem but i try to answer anyway...
(im not sure of the tips too sry)

-Make two array of Palyer group[5] (use index 1 to 4 in order to keep the relation easy between numer of player in group and its index in the array) and name it Team X (the X is 1 or 2)
- Make a button near each slot (1-4 of each team ) and name it like the slot (button 1-4 team 1-2)
- Make a trigger that does something like "If button X team x is pressed assign player to TeamX [x]"
- At the start of the game make all players in Team1 ally and all players of Team2 Ally.
- When you need to write the scoreaboard mae a trigger that write all index in Team1 and then oll index in Team2.

My 2 cent.
 

Dave312

Censored for your safe viewing
Reaction score
269
Is it possible to have more than 4 players on a team and did you want the scoreboard shown while players are changing teams?
 

X-maul

AKA: Demtrod
Reaction score
201
I might have explained it wrong...

In the lobby, the players can change move to different teams. Not in the actual game.
 

Jokker

Member
Reaction score
16
Ill try to help explain here.

So if you join a game. There are 3 people in the lobby. You are now Player 4.
But the game is 4v4 and you decide to change the team. So you go to the other team.

Now you are sitting where Player 5 should be, but you are still linked for the Editor as Player 4, if that makes any sense. The movement around the lobby doesnt define your Player status, but the joining of the lobby does.

This causes problems in the game though. If you link your scoreboard to show players 1-4 and 5-8, then a person that changed the team will be displayed incorrectly, as he is in Team 2 but shown in scoreboard Team 1.

I hope this makes sense.

Anyway. Imho we could do this the stupid way : D We need the turret, right? We could make it so that the turret is Player 9 and the other one is Player 10. Now we can actually pick every ally of the turret and make it Red Team or Blue Team, right? No? After that picking every player in group and putting it into the scoreboard is not hard.
 

Dave312

Censored for your safe viewing
Reaction score
269
You want to use the Players On Team function:
Code:
        Variable - Set RedTeam = (Players on team 1)
        Variable - Set BlueTeam = (Players on team 2)
 

X-maul

AKA: Demtrod
Reaction score
201
I already defined the players into different groups, the only problem is that I dont know how to create the different lines in the leaderboard, and if player 4 is first player in team 1, then I want to be able to just refer to "ScoreboardDialogItemKills[Triggering Player] or something like that.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
If you have already defined them into the correct player groups, why dont you just loop through the player groups? Say we have four players and they join every other team so player 1 and 3 is on team 1 and player 2 and 4 is on team 2.

You now want to first display a row for player 1, then a row for player 3, then player 2 then player 4, right?

Pick every player on (Players on team 1):
Leaderboard - show row something something

Pick every player on (Players on team 2):
Leaderboard - show row something something
 

X-maul

AKA: Demtrod
Reaction score
201
I tried to do this;
Code:
        Variable - Set Team Red = (Players on team 1)
        Variable - Set Team Blue = (Players on team 2)
        General - For each integer X from 1 to 4 with increment 1, do (Actions)
            Actions
                Variable - Set PLAYERNUMBER[X] = (Player X from Team Red)
        General - For each integer X from 5 to 8 with increment 1, do (Actions)
            Actions
                Variable - Set PLAYERNUMBER[X] = (Player (X - 4) from Team Blue)
        General - For each integer X from 1 to 8 with increment 1, do (Actions)
            Actions
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        (Status of player X) == Unused
                    Then
                        Variable - Set PLAYERNUMBER[X] = X
                    Else
And then I created the dialog like this;
Code:
        General - For each integer X from 1 to 4 with increment 1, do (Actions)
            Actions
                Variable - Set Offset = (65 + (35 * X))
                Dialog - Create an image for dialog (Last created dialog) with the dimensions (700, 50) anchored to Top Left with an offset of (10, Offset) setting the tooltip to "" using the image Assets\Textures\ui_glue_glowundertext_zerg.dds as a Normal type with tiled set to False tint color White and blend mode Normal
                Variable - Set Offset = (80 + (35 * X))
                Dialog - Create a label for dialog (Last created dialog) with the dimensions (300, 50) anchored to Top Left with an offset of (50, Offset) with the text (Name of player PLAYERNUMBER[X]) color set to (Color((Current player PLAYERNUMBER[X] color))) text writeout set to False with a writeout duration of 2.0
                Dialog - Set (Last created dialog item) style to ScoreboardText for (All players)
                Dialog - Create a label for dialog (Last created dialog) with the dimensions (100, 50) anchored to Top Left with an offset of (250, Offset) with the text (Text(Kills[PLAYERNUMBER[X]])) color set to (88%, 75%, 37%) text writeout set to False with a writeout duration of 2.0
                Variable - Set Scoreboard Kills[PLAYERNUMBER[X]] = (Last created dialog item)
                Dialog - Set (Last created dialog item) style to ScoreboardNumbers for (All players)
                Dialog - Create a label for dialog (Last created dialog) with the dimensions (100, 50) anchored to Top Left with an offset of (375, Offset) with the text (Text(Deaths[PLAYERNUMBER[X]])) color set to (88%, 75%, 37%) text writeout set to False with a writeout duration of 2.0
                Variable - Set Scoreboard Deaths[PLAYERNUMBER[X]] = (Last created dialog item)
                Dialog - Set (Last created dialog item) style to ScoreboardNumbers for (All players)
                Dialog - Create a label for dialog (Last created dialog) with the dimensions (100, 50) anchored to Top Left with an offset of (525, Offset) with the text (Text(Captures[PLAYERNUMBER[X]])) color set to (88%, 75%, 37%) text writeout set to False with a writeout duration of 2.0
                Variable - Set Scoreboard Captures[PLAYERNUMBER[X]] = (Last created dialog item)
                Dialog - Set (Last created dialog item) style to ScoreboardNumbers for (All players)
(Dont bother reading through it, the part I want you to see is the PLAYERNUMBER[X] parts)

And now it works :)
 

X-maul

AKA: Demtrod
Reaction score
201
Oh well, it doesnt work. For some reason It didnt work when we tested it again yesterday. Am I missing something here?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top