Warcraft III resources & community, 2003–2006 · archived

TD - Player Lives

1 posts
#1

TD - Player Lives

Player Lives:
In the most Tower Defense Maps players have lives or chances.
Usually when the lives or chances reach 0 the players loses the game.
Players loses lives when a creep enters the center where the creeps are supposed to be removed from the game.

Variable:
You have to create a variable to create the players lives.

http://img486.imageshack.us/img486/3985/playerlives13jb.png

You can change the amount of lives by editing the Initial Value.
In my TD I’ve set the Player lives to 50.

Set Player Lives:
Events
        Unit - A unit enters Creep Remove
    Conditions
        (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
    Actions
        Set Player_Lives = (Player_Lives - 1)
        Game - Display to (All players) for 5.00 seconds the text: (WARNING - + ((String(Player_Lives)) +  lives left!))
        Trigger - Run Defeat (checking conditions)


Then have another trigger like this:

Defeat:
Events
        Player - Player 10 (Light Blue)'s Food used becomes Equal to 0.00
    Conditions
        Player_Lives Equal to 0
    Actions
        Player Group - Pick every player in (All players) and do (Game - Defeat (Picked player) with the message: You have failed!)
The conversation continued. After wc3sear.ch closed, 1 further reply was posted to this thread on The Hive Workshop. Read them there →