HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

health help

01-19-2003, 02:22 AM#1
bunny_of_death
This is to those pro map mackers. i need help macking a map that has a leaderboard and shows a units healthemote_confused . I played Skycraft:D . and protect the king:D and they had that. plz tell me how to do this:D
01-19-2003, 04:05 AM#2
MrDoomMaster
Well this is quite simple. I'll show you an example of how to create a leaderboard that displays the health of a Peon owned by player one:

I suggest you already know how to create a leaderboard, so i'll just show you how to add unit's health to the leaderboard:

Actions:
Leaderboard - Add player 1 (red) to (leaderboard) with label Peon and value (integer((life of (unit))))


This will add the unit and his name to the leaderboard so it looks like this:

Peon 400

400 being his life.



If you wanted to refresh the life of the peon as he is hit, or so on, you would make a trigger like this:

Event:
Unit owned by player 1 is attacked

Condition:
Attacked unit equal to Peon 0001

Actions:
Leaderboard - Change the value for Player 1 (red) in (leaderboard) to (integer((life of (unit))))



I hope this helps! Please keep in mind, when choosing the value for the leaderboard player... you must choose Convert Real to Integer, so you may display the life of the unit. Good luck!