I have a problem. Say u have three players in the sc2 lobby, red blue and teal. If blue leaves the game then when my leaderboard is created there are two rows for the two players, red is in the first row and the second row is "blank". I would think this would be a common problem that would happen to everyones leaderboard, unless there is some way to avoid it. Is there anything you do to your trigger to preent it from happening. Ive tried many differnt methods of skipping over the empty user when adding players to the board, but nothing works. Ive even changed the color of the empty user to black and tried to sort it outside the bounds of the leader board but even that does not work. The empty user player type is treated very strangley, it is not counted when counting players, but it is checked and added to the leaderboard despite the fact that it is empty. Ya i dont have any code posted, again this is either a problem that everyone has and there is no solution to it, or the solution is well known and hopefully someone can just tell me.
You should be able to detect that the "blue" player is not currently playing. If you can't figure out how to do that, posting your current code might be a good start for us to best help you with your problem.
I dont have the Editor up right now, but im 100% sure theres a function called Status of Player or Player Status that checks if the player is active, meaning is still in game. You can use this to change the leaderboard row/col of the player name who is not active to "Not Playing" and with the text colored as a dark grey.
This is my code, i already check for active players, it does not count it in active players, but the leader board still checks for it. If you put a condition in to check for it it causes an infinite loop. This is the stable working code im using currently, the code that contains all the stuff i tried it all messy and unreadable and not funcional so i posted this.
Count#ofPlayersEventsGame-MapinitializationLocalVariablesConditionsActionsVariable-SetPlayerCount=0PlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsVariable-ModifyPlayerCount:+1Variable-SetPlayerCountHolder=PlayerCountTrigger-RunCreateLeadboard(IgnoreConditions,Don't Wait until it finishes)Trigger-RunSetEmptyToGrey(IgnoreConditions,Don't Wait until it finishes)CreateLeadboardEventsLocalVariablesConditionsActionsLeaderboard-Createaleaderboardwith3columnsand(PlayerCount+2)rows,withthename"Empires",andusing(100%,100%,100%)color.Variable-SetLeaderboard=(Lastcreatedleaderboard)Leaderboard-SetLeaderboarditemtextatcolumn1androw1to"Player"Leaderboard-SetLeaderboarditemtextatcolumn2androw1to"Income"Leaderboard-SetLeaderboarditemtextatcolumn3androw1to"Kills"Leaderboard-MoveLeaderboardto(1570,120)Leaderboard-Set(Lastcreatedleaderboard)itemtextcoloratcolumn1androw1to(Color(White))Leaderboard-Set(Lastcreatedleaderboard)itemtextcoloratcolumn2androw1to(Color(White))Leaderboard-Set(Lastcreatedleaderboard)itemtextcoloratcolumn3androw1to(Color(White))Leaderboard-Setwidthof1columnin(Lastcreatedleaderboard)to13.0(%ofthescreen)Timer-StartUPdateTimerasaRepeatingtimerthatwillexpirein1.0GameTimesecondsTrigger-TurnUpdateLeaderboard22OnTrigger-TurnUpdateLeaderboard2OnUpdateLeaderboard22EventsTimer-UPdateTimerexpiresLocalVariablesplr2=1<Integer>playerarrayspot=1<Integer>colorposition=0<Integer>Player=1<Integer>Postion=2<Integer>ConditionsActionsUI-Display"START"for(Allplayers)toSubtitleareaGeneral-While(Conditions)aretrue,do(Actions)Conditions(Postion-1)<(PlayerCount+1)ActionsVariable-SetPlayer=1Variable-Setcolorposition=(colorposition+1)General-While(Conditions)aretrue,do(Actions)Conditions------- first con: 1, 5 + 1------- actions: set player int = 1, set color position = 1------- second conditions player 1 < 5 + 1------- third conditions if current player color red = default player color red------- fourth conditions if current player color = default Emp setup------- else------- Vassal setupPlayer<(PlayerCountHolder+1)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditions(CurrentplayerPlayercolor)==(Defaultplayer(0+colorposition)color)ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(CurrentplayerPlayercolor)==(DefaultplayerPlayercolor)ThenUI-Display"E"for(Allplayers)toSubtitleareaVariable-SetIncome=(PlayerPlayerVespeneCurrentscore)Variable-SetKills=(PlayerPlayerEnemyUnitsKilledscore)Leaderboard-SetLeaderboarditemtextatcolumn1androwPostionto("E-"+(NameofplayerPlayer))Leaderboard-SetLeaderboarditemtextatcolumn2androwPostionto(Text(Income))Leaderboard-SetLeaderboarditemtextatcolumn3androwPostionto(Text(Kills))Leaderboard-SetLeaderboarditemtextcoloratcolumn1androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemtextcoloratcolumn2androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemtextcoloratcolumn3androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemalignmentatcolumn1androwPostiontoLeftVariable-ModifyPlayer:+1Variable-ModifyPostion:+1Variable-Modifyplayerarrayspot:+1Variable-Modifyplr2:+1ElseVariable-SetIncome=(PlayerPlayerVespeneCurrentscore)Variable-SetKills=(PlayerPlayerEnemyUnitsKilledscore)Leaderboard-SetLeaderboarditemtextatcolumn1androwPostionto(NameofplayerPlayer)Leaderboard-SetLeaderboarditemtextatcolumn2androwPostionto(Text(Income))Leaderboard-SetLeaderboarditemtextatcolumn3androwPostionto(Text(Kills))Leaderboard-SetLeaderboarditemtextcoloratcolumn1androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemtextcoloratcolumn2androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemtextcoloratcolumn3androwPostionto(Color((CurrentplayerPlayercolor)))Leaderboard-SetLeaderboarditemalignmentatcolumn1androwPostiontoLeftVariable-ModifyPlayer:+1Variable-ModifyPostion:+1Variable-Modifyplayerarrayspot:+1Variable-Modifyplr2:+1ElseVariable-ModifyPlayer:+1
I have a problem. Say u have three players in the sc2 lobby, red blue and teal. If blue leaves the game then when my leaderboard is created there are two rows for the two players, red is in the first row and the second row is "blank". I would think this would be a common problem that would happen to everyones leaderboard, unless there is some way to avoid it. Is there anything you do to your trigger to preent it from happening. Ive tried many differnt methods of skipping over the empty user when adding players to the board, but nothing works. Ive even changed the color of the empty user to black and tried to sort it outside the bounds of the leader board but even that does not work. The empty user player type is treated very strangley, it is not counted when counting players, but it is checked and added to the leaderboard despite the fact that it is empty. Ya i dont have any code posted, again this is either a problem that everyone has and there is no solution to it, or the solution is well known and hopefully someone can just tell me.
@lemmy734: Go
You should be able to detect that the "blue" player is not currently playing. If you can't figure out how to do that, posting your current code might be a good start for us to best help you with your problem.
@lemmy734: Go
I dont have the Editor up right now, but im 100% sure theres a function called Status of Player or Player Status that checks if the player is active, meaning is still in game. You can use this to change the leaderboard row/col of the player name who is not active to "Not Playing" and with the text colored as a dark grey.
This is my code, i already check for active players, it does not count it in active players, but the leader board still checks for it. If you put a condition in to check for it it causes an infinite loop. This is the stable working code im using currently, the code that contains all the stuff i tried it all messy and unreadable and not funcional so i posted this.