showing amount of lives left in a leaderboard

helpmeplease

New Member
Reaction score
7
i completely forgot and can't work it out. how do i show lives left in a board either multiboard of leader. idk which one

and while im on thehelper. can someone tell me the jass call remove thing for unit groups. i made a temporary one for a spell and i don't know how to do the call remove tempgroup
 

Inflicted

Currently inactive
Reaction score
63
ok if its just lives, then leaderboard is probably the easiest.
if your going to have like deaths and all that use a multiboard.

for a leaderboard:

create a variable array called Lives[12]
set it to the amount you want
and then have two triggers. one to create it and one to reduce the lives as a player dies.

To create:

Events:
Time - Elapsed game time is 5.00 seconds
Conditions:
Actions:
Leaderboard - Create a leaderboard for (All players) titled Lives
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value Lives[(Player number of (Picked player))]
Leaderboard - Show (Last created leaderboard)

To sort, remove lives and revive:

Events:
Unit - A unit Dies
Conditions:
(Unit-type of (Dying unit)) Equal to "The Hero"
Actions:
Set Lives[(Player number of (Owner of (Dying unit)))] = (Lives[(Player number of (Owner of (Dying unit)))] - 1)
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Change the value for (Picked player) in (Last created leaderboard) to Lives[(Player number of (Picked player))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
Wait 5.00 seconds
-------- Depending on how you revive the hero --------
Hero - Instantly revive (Dying unit) at (Random point in (Playable map area)), Show revival graphics
Selection - Select (Reviving Hero) for (Owner of (Dying unit))
Camera - Pan camera for (Owner of (Dying unit)) to (Position of (Reviving Hero)) over 0.01 seconds

sorry if this is hard to read, i will attactch a map if neccessary.
 

helpmeplease

New Member
Reaction score
7
ok if its just lives, then leaderboard is probably the easiest.
if your going to have like deaths and all that use a multiboard.

for a leaderboard:

create a variable array called Lives[12]
set it to the amount you want
and then have two triggers. one to create it and one to reduce the lives as a player dies.

To create:

Events:
Time - Elapsed game time is 5.00 seconds
Conditions:
Actions:
Leaderboard - Create a leaderboard for (All players) titled Lives
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value Lives[(Player number of (Picked player))]
Leaderboard - Show (Last created leaderboard)

To sort, remove lives and revive:

Events:
Unit - A unit Dies
Conditions:
(Unit-type of (Dying unit)) Equal to "The Hero"
Actions:
Set Lives[(Player number of (Owner of (Dying unit)))] = (Lives[(Player number of (Owner of (Dying unit)))] - 1)
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Change the value for (Picked player) in (Last created leaderboard) to Lives[(Player number of (Picked player))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
Wait 5.00 seconds
-------- Depending on how you revive the hero --------
Hero - Instantly revive (Dying unit) at (Random point in (Playable map area)), Show revival graphics
Selection - Select (Reviving Hero) for (Owner of (Dying unit))
Camera - Pan camera for (Owner of (Dying unit)) to (Position of (Reviving Hero)) over 0.01 seconds

sorry if this is hard to read, i will attactch a map if neccessary.

thank you very much
 

xz-master

New Member
Reaction score
2
To create:

Events:
Time - Elapsed game time is 5.00 seconds
Conditions:
Actions:
Leaderboard - Create a leaderboard for (All players) titled Lives
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value Lives[(Player number of (Picked player))]
Leaderboard - Show (Last created leaderboard)

To sort, remove lives and revive:

Events:
Unit - A unit Dies
Conditions:
(Unit-type of (Dying unit)) Equal to "The Hero"
Actions:
Set Lives[(Player number of (Owner of (Dying unit)))] = (Lives[(Player number of (Owner of (Dying unit)))] - 1)
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Leaderboard - Change the value for (Picked player) in (Last created leaderboard) to Lives[(Player number of (Picked player))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
Wait 5.00 seconds
-------- Depending on how you revive the hero --------
Hero - Instantly revive (Dying unit) at (Random point in (Playable map area)), Show revival graphics
Selection - Select (Reviving Hero) for (Owner of (Dying unit))
Camera - Pan camera for (Owner of (Dying unit)) to (Position of (Reviving Hero)) over 0.01 seconds

sorry if this is hard to read, i will attactch a map if neccessary.

I get stuck at this point: how do i make it '- 1' and not '-1'? :confused:
I want it to reduce the number of lives by 1, not set it to -1
 

Inflicted

Currently inactive
Reaction score
63
well what your doing is taking the lives variable and subtracting one.

" Set Lives [(Player number of (Owner of (Dying unit)))] = (Lives[(Player number of (Owner of (Dying unit)))] - 1) "

this doesnt set it, it reduces.
 

Inflicted

Currently inactive
Reaction score
63
ok i will list steps

-new action
-set variable
-select lives
-set index[] to "Player - Player Number
-set the player to Owner of Unit
-set that to Event Response - Dying Unit

then press ok a few times

-then click on the red text value, next to the equals sign
-find arithmetic
-value:
{ -select lives
-set index[] to "Player - Player Number
-set the player to Owner of Unit
-set that to Event Response - Dying Unit } this again
-then change the arithmetic sign to subtract/minus (-)

then just hit ok a few times.

hope this helped.
 
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