• 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.

[Trigger] Lives

Status
Not open for further replies.
Level 2
Joined
Feb 24, 2008
Messages
12
I searched the forums for about 10 minutes thinking there would have been some other threads about declaring lives and making them display on leaderboard. However i could not find any threads about this topic. So I was hoping someone could give me a simple GUI trigger to 1)Declare lives and make them reconizable for 6 players 2) Display them in leaderboard and make them change appropiatly when lives are lost when creeps enter the region they are directed to run to. Thank you very much. BTW. After i get lives working, all i need to modify is towers and my map(TD) will be completed! So thanks again.
 
Level 5
Joined
May 21, 2006
Messages
174
First declare the variable 'Lives' as integer array and 'Leaderboard' as Leaderboard in the variable editor (Ctrl+B).
  • Create Leaderboard
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled TITLE HERE
      • Set Leaderboard = (Last created leaderboard)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Lives[(Integer A)] = 50
          • Leaderboard - Add (Player((Integer A))) to Leaderboard with label (Name of (Player((Integer A)))) and value Lives[(Integer A)]
      • Leaderboard - Show Leaderboard
As for the reduce lives trigger you can use different approaches depending on how the map is made, but first you basically have to have a way to find out which player leaked a creep, then simply reduce the 'Lives' variable by -1 when a creep enters the selected region and then update the leaderboard with a "Leaderboard - Change player value" action.
 
Status
Not open for further replies.
Top