ok someone tell me what I'm doing wrong. What I want is my map to store wins, losses, win/loss ratio and then display them on the leaderboard
My triggers are as follows:
open bank, store real value (real arithmetic (wins + 3), store real value (real arithmetic (losses + 1), save bank
leaderboard - set item text as (convert real to text) wins - leaderboard - set item text as (convert real to text) losses - leaderboard - set item text as (convert real to text) real arithmetic (wins / losses) 2 decimals
however what I end up getting is my leaderboard displaying,
wins 1, losses 0, win/loss (nothing)
what the hell?????? I run the trigger multiple times so wins should stack way up but it just keeps displaying 1 and losses 0.
It worked fine as an integer however I don't believe you can have decimal places with the integer so I turned the numbers into real and now it doesn't work.
Holy hell, I found the problem. On my store value losses, I loaded losses + 1 and saved under the key wins, thereby erasing my wins, saving nothing under losses and making me go crazy.
I found it when I started renaming my keys to try and solve the problem. Crisis averted, you may all now carry on.
Yeah, I just completed this, without the ratio, I have the problem where the leaderboard looks, hmm unprofessional, does not look that good. it needs more detail and borders but I dont know how to add it, can you guys hepl?
I think yours looks better than mine. Attached. I meant to do that mouse over for more detail but oh well. Oh wait, you're missing your Header Lines, see below link for leaderboards. When you're picking the row in the trigger double click the row section and change the number to Header and set headers. Also you have pretty big borders around your info. I'm not sure how but I'd try to reduce them. Less is usually more on interfaces. Mines huge but it can be minimized and you're not really meant to play with it up.
Swagblanket, 1: nice name. 2: banks
3: leaderboards
Just a random tip, thou shall not divide by zero on win / loss ratio's. The action will give you a trigger error and the actions after that will just not run. I was beating my head earlier over this. Just do, Condition: If losses = 0, then display Wins, else display Wins / Losses.
You can have 0 / 5 but not 5 / 0. Unless you are Chuck Norris. Then you can divide by 0 no problem.
Mine is a dialog, as it is less buggy and you can get thte tooltips so its not such a long leaderboard. Therfor, i dont know how to make it look like the actual leaderboard thaat I used to havea.
I was able to implement my bank/leaderboard, however, 2 issues.
1. how'd you get that sexy line between your first and second row on your leaderboard?
2. while offline and testing my map through the editor, I am easily able to hack my bank file and increase my wins even with Bank Signatures Enabled. I'm hoping that on bnet it would function normally, but I have no idea.
If I may offer a suggestion, you could minimize the size of your leaderboard by instead of displaying "Not Playing" simply remove the row entirely. Though, I guess if you only have 4 players, then it's not really a big deal.
@CrazyTwigman:
Leaderboards are the way to go, imho. They look really sharp, and can be easily minimized. The tooltips are a nice benefit of using a dialogs, but its kinda difficult, for me at least, to view my tooltip in the heat of battle. Anyways, maybe there's a way to add tooltips to leaderboards?
Edit: ah nevermind, forget #1. I saw you need to set the row to Header to get the line.
2. I've never messed with protecting/hacking bank files so not sure. (if they want to alter their stats on my map that bad they can knock themselves out)
Hmm, I would like to remove the row if they're not playing. How do you do that?
I noticed they have a Change number of rows trigger, which would take more if / then's to get the proper rows, and then all my triggers that update the leaderboard are matched to the player number / row number and I don't know what chaos that route would ensue.
Then I found the, set player column, add player to leaderboard, however when I tried doing this I ended up with one nice row, however my header font size was ridiculously large and I couldn't get it back to normal.
I did however do one thing that reduced its size pretty well. I created a dialog button for my leaderboard and then hid the minimize button and disabled the title. See below for the triggers.
(I just discovered the right click a trigger and copy to text so I may abuse this - I also just found setting the Markup Type to Plain Text on this forums drop down menu lets you keep all your new lines.)
Leaderboard - Disable Show Title state for leaderboard for (All players)
Leaderboard - Hide leaderboard minimize button for (All players)
General - Pick each integer from 1 to 4, and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering player) == (Picked integer)
Scores pressed[(Picked integer)] == 0
Then
Leaderboard - Maximize leaderboard for (Player group((Picked integer)))
Variable - Set Scores pressed[(Picked integer)] = 1
Else
Leaderboard - Minimize leaderboard for (Player group((Picked integer)))
Variable - Set Scores pressed[(Picked integer)] = 0
Yeah getting rid of the title and button saves a lot of space, I like it.
You have the right idea of how to get rid of the rows. The key is to create two new variables, one local, CurrentRow, and one global, PlayerRow[12] (an array). The trigger works by starting with row 1, and picks each integer from 1 to 12, which represents each player. If the picked integer/player is playing, it assigns row 1 into PlayerRow[Picked Integer] = CurrentRow, then increases the current row by 1. Now, it continues on looking for an active player to fill row 2. Once it does, at the finish it increases to row 3, etc. To take care of your leaderboard when someone gets a kill, instead of using...row (triggering player)...use...row (PlayerRow[Triggering Player]). Note that in an earlier trigger I created a variable NumberOfPlayers, that finds the number of active players, and it's used below.
Initialize Leaderboards
Events
Game - Map initialization
Local Variables
CurrentRow = 1 <Integer>
Conditions
Actions
Leaderboard - Create a leaderboard with 4 columns and NumberOfPlayers rows, with the name "Leaderboard", and using (100%, 100%, 100%) color.
General - Pick each integer from 1 to 12, and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Picked integer)) == Playing
Then
Leaderboard - Set (Last created leaderboard) item text at column 2 and row CurrentRow to (Name of player (Picked integer))
Leaderboard - Set (Last created leaderboard) item text at column 3 and row CurrentRow to "0"
Leaderboard - Set (Last created leaderboard) item text color at column 2 and row CurrentRow to (Color((Current player (Picked integer) color)))
Variable - Set PlayerRow[(Picked integer)] = CurrentRow
Variable - Modify CurrentRow: + 1
Else
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
(how do I get a single new line on this forum?)
ok someone tell me what I'm doing wrong. What I want is my map to store wins, losses, win/loss ratio and then display them on the leaderboard
My triggers are as follows:
open bank, store real value (real arithmetic (wins + 3), store real value (real arithmetic (losses + 1), save bank
leaderboard - set item text as (convert real to text) wins - leaderboard - set item text as (convert real to text) losses - leaderboard - set item text as (convert real to text) real arithmetic (wins / losses) 2 decimals
however what I end up getting is my leaderboard displaying, wins 1, losses 0, win/loss (nothing)
what the hell?????? I run the trigger multiple times so wins should stack way up but it just keeps displaying 1 and losses 0.
It worked fine as an integer however I don't believe you can have decimal places with the integer so I turned the numbers into real and now it doesn't work.
Holy hell, I found the problem. On my store value losses, I loaded losses + 1 and saved under the key wins, thereby erasing my wins, saving nothing under losses and making me go crazy.
I found it when I started renaming my keys to try and solve the problem. Crisis averted, you may all now carry on.
@GreyHunter4:
I'm about to attempt a similar thing, I'm coming to you should I fail :)
Yeah, I just completed this, without the ratio, I have the problem where the leaderboard looks, hmm unprofessional, does not look that good. it needs more detail and borders but I dont know how to add it, can you guys hepl?
I think yours looks better than mine. Attached. I meant to do that mouse over for more detail but oh well. Oh wait, you're missing your Header Lines, see below link for leaderboards. When you're picking the row in the trigger double click the row section and change the number to Header and set headers. Also you have pretty big borders around your info. I'm not sure how but I'd try to reduce them. Less is usually more on interfaces. Mines huge but it can be minimized and you're not really meant to play with it up.
Swagblanket, 1: nice name. 2: banks
3: leaderboards
Just a random tip, thou shall not divide by zero on win / loss ratio's. The action will give you a trigger error and the actions after that will just not run. I was beating my head earlier over this. Just do, Condition: If losses = 0, then display Wins, else display Wins / Losses.
You can have 0 / 5 but not 5 / 0. Unless you are Chuck Norris. Then you can divide by 0 no problem.
I liek yours way better :O
Is yours actually a leaderboard?
Mine is a dialog, as it is less buggy and you can get thte tooltips so its not such a long leaderboard. Therfor, i dont know how to make it look like the actual leaderboard thaat I used to havea.
@GreyHunter4:
Thank you sir.
I was able to implement my bank/leaderboard, however, 2 issues.
1. how'd you get that sexy line between your first and second row on your leaderboard?
2. while offline and testing my map through the editor, I am easily able to hack my bank file and increase my wins even with Bank Signatures Enabled. I'm hoping that on bnet it would function normally, but I have no idea.
If I may offer a suggestion, you could minimize the size of your leaderboard by instead of displaying "Not Playing" simply remove the row entirely. Though, I guess if you only have 4 players, then it's not really a big deal.
@CrazyTwigman:
Leaderboards are the way to go, imho. They look really sharp, and can be easily minimized. The tooltips are a nice benefit of using a dialogs, but its kinda difficult, for me at least, to view my tooltip in the heat of battle. Anyways, maybe there's a way to add tooltips to leaderboards?
Edit: ah nevermind, forget #1. I saw you need to set the row to Header to get the line.
2. I've never messed with protecting/hacking bank files so not sure. (if they want to alter their stats on my map that bad they can knock themselves out)
Hmm, I would like to remove the row if they're not playing. How do you do that?
I noticed they have a Change number of rows trigger, which would take more if / then's to get the proper rows, and then all my triggers that update the leaderboard are matched to the player number / row number and I don't know what chaos that route would ensue.
Then I found the, set player column, add player to leaderboard, however when I tried doing this I ended up with one nice row, however my header font size was ridiculously large and I couldn't get it back to normal.
I did however do one thing that reduced its size pretty well. I created a dialog button for my leaderboard and then hid the minimize button and disabled the title. See below for the triggers.
(I just discovered the right click a trigger and copy to text so I may abuse this - I also just found setting the Markup Type to Plain Text on this forums drop down menu lets you keep all your new lines.)
Leaderboard - Disable Show Title state for leaderboard for (All players)
Leaderboard - Hide leaderboard minimize button for (All players)
Event: Dialog item pressed,
Condition: item pressed = stats
General - Pick each integer from 1 to 4, and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering player) == (Picked integer)
Scores pressed[(Picked integer)] == 0
Then
Leaderboard - Maximize leaderboard for (Player group((Picked integer)))
Variable - Set Scores pressed[(Picked integer)] = 1
Else
Leaderboard - Minimize leaderboard for (Player group((Picked integer)))
Variable - Set Scores pressed[(Picked integer)] = 0
Yeah getting rid of the title and button saves a lot of space, I like it.
You have the right idea of how to get rid of the rows. The key is to create two new variables, one local, CurrentRow, and one global, PlayerRow[12] (an array). The trigger works by starting with row 1, and picks each integer from 1 to 12, which represents each player. If the picked integer/player is playing, it assigns row 1 into PlayerRow[Picked Integer] = CurrentRow, then increases the current row by 1. Now, it continues on looking for an active player to fill row 2. Once it does, at the finish it increases to row 3, etc. To take care of your leaderboard when someone gets a kill, instead of using...row (triggering player)...use...row (PlayerRow[Triggering Player]). Note that in an earlier trigger I created a variable NumberOfPlayers, that finds the number of active players, and it's used below.
Initialize Leaderboards
Events
Game - Map initialization
Local Variables
CurrentRow = 1 <Integer>
Conditions
Actions
Leaderboard - Create a leaderboard with 4 columns and NumberOfPlayers rows, with the name "Leaderboard", and using (100%, 100%, 100%) color.
General - Pick each integer from 1 to 12, and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Picked integer)) == Playing
Then
Leaderboard - Set (Last created leaderboard) item text at column 2 and row CurrentRow to (Name of player (Picked integer))
Leaderboard - Set (Last created leaderboard) item text at column 3 and row CurrentRow to "0"
Leaderboard - Set (Last created leaderboard) item text color at column 2 and row CurrentRow to (Color((Current player (Picked integer) color)))
Variable - Set PlayerRow[(Picked integer)] = CurrentRow
Variable - Modify CurrentRow: + 1
Else