• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Triggers-Show specific unit's life on LeaderBoard

Status
Not open for further replies.
Level 3
Joined
May 6, 2006
Messages
44
Im making a map, kinda like hero siege, but i need a trigger(s) to make the unit's life appear on the leaderboard. i tried making it so that the gold = the unit's life, and in leaderboard, set the player's value to gold, kinda confusing, but then i couldnt find how to set the gold = the units life...
 
Level 3
Joined
May 12, 2006
Messages
35
hi

i dont think u can change gold to life with triggers

butt

E: Every 0.01 seconds
C: N/A
A: Set players current Gold to ((convert real to integer)[[[Units Life]]](owner of unit (set variable for unit of player))

---------------------------

E: Every 0.01 seconds
C:
A: Change Value For Player(1) on (leadboard) to (life of unit (set variable
 
Level 5
Joined
Nov 14, 2004
Messages
159
do you NEED gold for that? what about variable? with player 1 and 2 hero, it's done like this, just 2 triggers.

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Wait 1.00 seconds
        Leaderboard - Create a leaderboard for (All players) titled Health
        For each (Integer A) from 1 to 2, do (Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label HP:  and value health[(Integer A)])

Code:
constant
    Events
        Time - Every 0.20 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (If (((Picked unit) is A Hero) Equal to True) then do (Set health[(Player number of (Owner of (Picked unit)))] = (Integer((Life of (Picked unit))))) else do (Do nothing))
        For each (Integer A) from 1 to 2, do (Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to health[(Integer A)])

sorry if this doesnt match your need, I don't know what's your "specific" unit health, and I don't know how many players, change it around to match your need.
 
Level 5
Joined
Mar 12, 2005
Messages
117
Check it if you go to the tutorials section on this web site there is a tutorial which actaully tells you bit by bit (with pictures!! :) ) how to make life and mana show up on a leader board!! and using icons as well to represnet them how cool is that :D
 
Level 3
Joined
May 6, 2006
Messages
44
well, i need something more like haloboycs

theres 7 user players, and 3 computers, each have one hero, and 1 of the comps is the unit that musnt die, lets say the "Specific" unit is a footman. I need to view the footman's life on the leaderboard, i already got a leaderboard with kills, can i have 2?

and you said i need variables? what should the variables be? i suck at variables

and yeah, ill check the tuturials
 
Level 9
Joined
Sep 8, 2004
Messages
633
NoobMag said:
well, i need something more like haloboycs

theres 7 user players, and 3 computers, each have one hero, and 1 of the comps is the unit that musnt die, lets say the "Specific" unit is a footman. I need to view the footman's life on the leaderboard, i already got a leaderboard with kills, can i have 2?

and you said i need variables? what should the variables be? i suck at variables

and yeah, ill check the tuturials

If you need two leaderboards, i suggest converting to a multiboard, on a multiboard you can display as many things as you want, but they are a bit more complex to make, although the basics are the same. I'd recommend you to look for a tutorial on multiboards, there's many of them around.
 
Status
Not open for further replies.
Top