• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Td stop spawn?

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
Can anyone show me how to stop spawning units when a player has died?
Here is my spawns as it is now:
  • Events
    • Time - Elapsed game time is 25.00 seconds
  • Conditions
  • Actions
    • Game - Display to (All players) the text: Level 1 - Stag.
    • Trigger - Turn on Level 1 Spawns <gen>
And:
  • Events
    • Time - Every 2.00 seconds of game time
  • Actions
    • Unit - Create 1 Stag 1 for Player 7 (Green) at (Center of Player1RegStart <gen>) facing Default building facing degrees
    • Unit - Create 1 Stag 1 for Player 7 (Green) at (Center of Player2RegStart <gen>) facing Default building facing degrees
    • Unit - Create 1 Stag 1 for Player 7 (Green) at (Center of Player3RegStart <gen>) facing Default building facing degrees
    • Wait 18.00 seconds
    • Trigger - Turn off (This trigger)
 
Level 3
Joined
May 3, 2008
Messages
44
It depends on what you're using for play "lives". Are you using variables, or something else like gold or lumber? Also, when your players are defeated, do you have them removed from the game

  • Game - Defeat (Player) with the message (some message here)
or do you let them stay and watch the game?

quick answer: I think that when a player loses, you should turn on another trigger like this

  • Player 1 dies
  • Events
    • A unit enters <player 1's creep spawn>
  • Conditions
    • some condition here...
  • Actions
    • Unit - Remove (Entering unit) from the game
 
Level 25
Joined
Mar 23, 2008
Messages
1,813
I use variables, and here is my defeat triggers:
  • Events
    • Unit - A unit enters Player1RegEnd <gen>
  • Conditions
    • (Owner of (Triggering unit)) Equal to Player 7 (Green)
  • Actions
    • Set LifesPlayer1 = (LifesPlayer1 - 1)
    • Game - Display to Player Group - Player 1 (Red) the text: (You have lost a life, you now have + (String(LifesPlayer1)))
    • Unit - Explode (Entering unit)
    • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to LifesPlayer1
    • Trigger - Run Player1Defeat <gen> (checking conditions)
  • Events
  • Conditions
    • LifesPlayer1 Less than or equal to 0
  • Actions
    • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • Game - Defeat Player 1 (Red) with the message: You lost!
 
Level 5
Joined
Jul 25, 2008
Messages
126
Code:
Turn off Spawn
    Events
        Unit - A unit owned by Player 1 (Red) Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Trigger - Turn off Level 1 Spawns <gen>

Edit:: opps thought you meant hero not player

Code:
Turn off Spawn
    Events
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        
    Actions
        If (LifesPlayer1 Less than or equal to 0) then do (Trigger - Turn off Level 1 Spawn <gen>) else do (Do nothing)
 
Level 5
Joined
Jul 25, 2008
Messages
126
If I understand you correctly all spawns for all players are in 1 trigger together the only way I can think of is maybe make it so that if the player is defeated make it so the units are removed from there spawn point every time a spawn happens for that player.
 
Level 3
Joined
May 3, 2008
Messages
44
you can remove a region. it's a custom script.

Custom Script: Call RemoveLocation(udg_regionname)

at least that's how I think the code goes, but i think removing a region would bug your game. it's best to just remove the unit when it enters the region
 
Level 17
Joined
May 6, 2008
Messages
1,598
you can remove a region. it's a custom script.

Custom Script: Call RemoveLocation(udg_regionname)

at least that's how I think the code goes, but i think removing a region would bug your game. it's best to just remove the unit when it enters the region
I think you don't have any idea what you are talking about.

You do not destroy the region, you remove the location a variable is assigned to.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
you can remove a region. it's a custom script.

Custom Script: Call RemoveLocation(udg_regionname)
What the fuck?
Removing a region goes like call RemoveRect(udg_region <gen>)

Anyways, just make a condition using the amount of lives left for the respective players to decide whether spawn the creeps or not.
Just put something like this into your spawntrigger:

  • Actions
    • If Lives_of_player_1 Greater than 0 then do Unit Create x George W. Bush at (Center of (Playable map area)) else do nothing
 
Level 3
Joined
May 3, 2008
Messages
44
  • Player 1 dies
  • Events
    • A unit enters <player 1's creep spawn>
  • Conditions
    • some condition here...
  • Actions
    • Unit - Remove (Entering unit) from the game

isnt your solution what I said in the first place? And I said I THINK you can remove a region, not "Omg I'm absolutely sure this has to be the way i'm right you're wrong" so don't jump on me for trying to be constructive guys =P
 
Status
Not open for further replies.
Top