reverse leaderboard

D

darkmaster24

Guest
im trying to make a leaderboard for a warcraft frozen throne map where instead of increasing it goes backwards and starts from 20, and when someone hits 0 they lose. using my cureent trigger it jumps from 20 to 0 and the player loses straight away. the trigger im using: (lives is the name of the variable)

events:
Unit - A unit Dies
conditions:
none
actions:
Set lives[(Player number of (Owner of (Triggering unit)))] = lives[(lives[(Player number of (Owner of (Triggering unit)))] - 1)]
Leaderboard - Change the value for (Owner of (Triggering unit)) in (Last created leaderboard) to lives[(Player number of (Owner of (Triggering unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order

can someone give me one that works please
 
D

DarthTyranus

Guest
Reply

You could get really bogged down in integers, but it would be simpler just to create an area in the map and create a unit called lives or whatever. turn this units collision size to zero and then put twenty of them in this area. Give them to a nuetral person. Then do a trigger like

Event - Every 1 second of game time
Conditions - None
Action - Set Integer = live[1] = Number of Lives in Player1LivesArea<gen>
- Arrange Last Created Leaderboard in Ascending order

That is just an idea. Let me know if it helps. If it does not then I will try to find a solution to the integer problem. :banghead:
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
This

Set lives[(Player number of (Owner of (Triggering unit)))] = lives[(lives[(Player number of (Owner of (Triggering unit)))] - 1)


Should be this:

Set lives[(Player number of (Owner of (Triggering unit)))] = lives[(Player number of (Owner of (Triggering unit)))] - 1)]
 

sqrage

Mega Super Ultra Cool Member
Reaction score
514
You could get really bogged down in integers, but it would be simpler just to create an area in the map and create a unit called lives or whatever. turn this units collision size to zero and then put twenty of them in this area. Give them to a nuetral person. Then do a trigger like

meh its usally better to just learn what u dont know :p
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Phreyx1an is right; use his. It's probably just a little accident.
 
L

lazarusxl

Guest
I use 2 values in my leaderboard... This is not possible? True, but I did it like this:

the player name consists of INTEGER+"-"+PLAYER NAME


the integer indicates the number of lives left (start with 40), the value indicates the number of kills, so my leaderboard looks like this:

NAME VALUE
35-LazarusXL 662
40-DarkMaster24 565

When a player loses a life I just change the player name to Lives(1)-1+"-"+name of player 1 Red


I hope this helps.
 
D

darkmaster24

Guest
DarthTyranus said:
You could get really bogged down in integers, but it would be simpler just to create an area in the map and create a unit called lives or whatever. turn this units collision size to zero and then put twenty of them in this area. Give them to a nuetral person. Then do a trigger like

Event - Every 1 second of game time
Conditions - None
Action - Set Integer = live[1] = Number of Lives in Player1LivesArea<gen>
- Arrange Last Created Leaderboard in Ascending order

That is just an idea. Let me know if it helps. If it does not then I will try to find a solution to the integer problem. :banghead:
darth, you could but i need it for 8 players so it would take a long time. but its a nice idea for a smaller map i guess. plus on mine the entire map is visible so people would be able to see. its still a good idea but it might take a long time

ill try phyrex1an's method and if i cxant get it to work like i normally cant ill try lazarusxl's

edit: phyrex1an's hasnt worked now it just stays at 20
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
I have found what is wrong... I think.

"Triggering Unit" should be "Dying Unit"

events:
Unit - A unit Dies
conditions:
none
actions:
Set lives[(Player number of (Owner of (Dying Unit)))] = lives[(Player number of (Owner of (Dying Unit)))] - 1)]
Leaderboard - Change the value for (Owner of (Dying Unit)) in (Last created leaderboard) to lives[(Player number of (Owner of (Dying Unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
 
D

darkmaster24

Guest
nope i got nothing, ill upload the map if you like so you can have a look at it and maybe find whats wrong
 
L

lazarusxl

Guest
that would be easiest yes

what doesnt work of the trigger I posted, in your map ?
 
S

Senkin

Guest
You know what, if all of the other guys ideas dont work I know of one that I myself use on my td.
As a matter of a fact I use 20 lives too.

Here is an example to its entirety.

Leaderboard - Add Player 11 (Dark Green) to (Last created leaderboard) with label (Lives + (String(Lives))) and value -2

Leaderboard - Change the display style for Player 11 (Dark Green) in (Last created leaderboard) to Show the label, Hide the value, and Hide the icon

That is the part to show the lives in the leaderboard. As for the player in bold that can be any player that does no be used by a player at all.

Now to have it so the lives decreces as a creep goes into the center or whatnot to cause a life loss here is my trigger I use that is changed a bit so you can understand it better, all you need to do is mod it a little to your map's system.

leak
Events
Unit - A unit enters Center <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
Actions
Set Lives = (Lives - 1)
Leaderboard - Change the label for Player 11 (Dark Green) in (Last created leaderboard) to (Lives + (String(Lives)))


That bold player has to be the same player as the one in the leaderboard to work
but there ya go

P.S the value -2 in

Leaderboard - Add Player 11 (Dark Green) to (Last created leaderboard) with label (Lives + (String(Lives))) and value -2

is to make sure the lives player stays on the bottom of the leaderboard since I have another player acting as a seperator and the other players change around by the amout of kills they have.
 
S

Senkin

Guest
I can also do much more and better for you.

If you would like you can send me the map and I can make a leaderboard and the lives thing for you exactally how you want it.

Just PM me or contact me by my AIM account if you want to.
 
D

darkmaster24

Guest
heres the map

and when someone has managed to figure out how to work it can you send me it back please as theres still some small things i need to change

edit: removed, trigger code fixed!
 
L

lazarusxl

Guest
phyrex1an said:
I have found what is wrong... I think.

"Triggering Unit" should be "Dying Unit"

No, in this case Triggering unit is equal to Dying unit so it doesn't matter. Triggering unit is fine.
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Yes, but either way, it's good practice. It's neater and can cause problems in the future.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
I have found what is wrong... for real this time.

when a unit dies you you change the value of
live(player number of(owner of triggering unit)
=
[live((player number of(owner of triggering unit)-1)

it should be like this:
live(player number of(owner of triggering unit)
=
live(player number of(owner of triggering unit)-1

see the diffenrens:

[live((player number of(owner of triggering unit)-1)]
should be
live(player number of(owner of triggering unit)-1

your trigger sets the vaule of lives for player number x = lives of player number (x-1)

understand? I am not to good to explaine things in english
 
D

darkmaster24

Guest
i see you took away the brackets, i only dont know how to get rid of them...

can you tell me how please?
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
I don't think that that is actually wrong. Looking at those, it seems to me like he just wrote them wrong here, since the editor adds them automatically..
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top