Condition:
killing player and triggering player treat each other as enemies == true
Actions:
If
killing player is in players on team 1
Then
Pick each player in active players
if
picked player is in players on team 1
then
modify player property minerals: +x
modify player property vespene: +y
Else
Pick each player in active players
if
picked player is in players on team 2
then
modify player property minerals: +x
modify player property vespene: +y
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
Don't worry about having things not work your first attempts with the editor, it happens to everyone. The good news is your error is easily fixable.
Solution:
1. In trigger "Create" move the line "Leaderboard - Create a leaderboard with..." to the top, this needs to be the first command.
2. create a global variable (not a local variable) called "Kill Board", or whatever you want, and change the "type" to "leaderboard"
3. In trigger "Create", at the second line (underneath Leaderboard - Create), use "set variable" -> "Set (last created leaderboard) = Kill Board
4. In trigger "Unit Dies", inside of the Then statement for (Killing Player) = 1, after "variable - modify P1Kills: +1" add a line called "Set (Kill Board) item text at column 2 row 1 to [convert integer to text (P1Kills) ]. Do this for each player
Done!
Note that if there are not other players in the game, then the leaderboard will appear empty except for your own name.
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.
Hmm, it's really hard for me to tell what exactly is going on. I'm assuming the hero unit has a variable assigned to it, so your method may look something like...
Event
Any Unit Starts Attacking
Conditions
Or
Attacking Unit == HeroUnit[1]
Attacking Unit == HeroUnit[2]...
... Attacking Unit == HeroUnit[n]
Actions
modify Ammo[Attacking Unit]: -1
Then somewhere else in a dialog you have it show the variable Ammo[] which periodically updates or something? I still can't figure out why multiple units shooting would cause en error...
0
@thepumaman1
Event:
Unit Dies
Condition:
killing player and triggering player treat each other as enemies == true
Actions:
If
killing player is in players on team 1
Then
Pick each player in active players
if
picked player is in players on team 1
then
modify player property minerals: +x
modify player property vespene: +y
Else
Pick each player in active players
if
picked player is in players on team 2
then
modify player property minerals: +x
modify player property vespene: +y
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
0
Just wanna say you guys are genius, this was exactly what I was looking for!! Thanks!
0
@LunaticGirge
Don't worry about having things not work your first attempts with the editor, it happens to everyone. The good news is your error is easily fixable.
Solution:
1. In trigger "Create" move the line "Leaderboard - Create a leaderboard with..." to the top, this needs to be the first command.
2. create a global variable (not a local variable) called "Kill Board", or whatever you want, and change the "type" to "leaderboard"
3. In trigger "Create", at the second line (underneath Leaderboard - Create), use "set variable" -> "Set (last created leaderboard) = Kill Board
4. In trigger "Unit Dies", inside of the Then statement for (Killing Player) = 1, after "variable - modify P1Kills: +1" add a line called "Set (Kill Board) item text at column 2 row 1 to [convert integer to text (P1Kills) ]. Do this for each player
Done!
Note that if there are not other players in the game, then the leaderboard will appear empty except for your own name.
0
@saucysoup: Go
Welcome saucysoup!
0
Thanks so much for this compilation, incredibly useful!
0
Try:
File > Dependency > Add Campaign
0
@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.
0
@Bibendus:
I was just wondering myself where they went, glad someone made a thread :)
0
@neverwin1011:
Hmm, it's really hard for me to tell what exactly is going on. I'm assuming the hero unit has a variable assigned to it, so your method may look something like...
Event
Any Unit Starts Attacking
Conditions
Or
Attacking Unit == HeroUnit[1]
Attacking Unit == HeroUnit[2]...
... Attacking Unit == HeroUnit[n]
Actions
modify Ammo[Attacking Unit]: -1
Then somewhere else in a dialog you have it show the variable Ammo[] which periodically updates or something? I still can't figure out why multiple units shooting would cause en error...
0
@neverwin1011
Are you using Unit is Attacked, Unit Starts Attacking, or Unit Takes Damage?
Also, are there any Conditions in your trigger? If so, what exactly are you trying to accomplish?
0
@GreyHunter4:
I'm about to attempt a similar thing, I'm coming to you should I fail :)
0
@OneTwoSC:
I just watched your video on banks, big help, and really straightforward.
Thanks again everyone for the welcomes :D
Within the next week I'll post a game play video of something I'm working on, so I'm curious what everyone's take on it will be.
0
Thanks for the warm welcome everyone, happy holidays :)
0
Just a quick hello; I'm new to the forums, they've helped me with a bunch of issues, so I'm happy to help back!
See you around,
Swagblanket