• 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] Units/hero wont die when base dies

Status
Not open for further replies.
Level 2
Joined
Aug 23, 2008
Messages
6
I have a problem. When the base dies, the units and hero do not although spawning stops (footmen map) here is what I got so far:

Code:
Building Destroyed
    Events
        Unit - A unit Dies
    Conditions
        (Dying unit) Equal to Base[(Player number of (Owner of (Dying unit)))]
    Actions
        Set xu = (Dying unit)
        Set xpl = (Owner of xu)
        Game - Display to PlayersPlaying the text: (PlayerName[(Player number of (Triggering player))] + |cffff0000 has been defeated!!|r)
        Set TempGroup = (Units owned by xpl)
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
                Unit - Remove (Picked unit) from the game
        Custom script:    call DestroyGroup (udg_TempGroup)
        Player Group - Remove xpl from PlayersPlaying
        Player Group - Pick every player in PlayersPlaying and do (Actions)
            Loop - Actions
                Set TempForce = (All players matching ((((Matching player) is an enemy of (Picked player)) Equal to True) and (((Matching player) is in PlayersPlaying) Equal to True)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of players in TempForce) Equal to 0
                    Then - Actions
                        Player Group - Pick every player in PlayersPlaying and do (Actions)
                            Loop - Actions
                                Game - Display to PlayersPlaying for 30.00 seconds the text: Game Victory in 60 ...
                                Wait 60.00 seconds
                                Game - Victory (Picked player) (Show dialogs, Show scores)
                    Else - Actions
                Custom script:    call DestroyForce (udg_TempForce)

The alternative trigger I have is this

Code:
Building Destroyed Copy
    Events
        Unit - A unit Dies
    Conditions
        (Dying unit) Equal to Base[(Player number of (Owner of (Dying unit)))]
    Actions
        Set TempUnit = (Dying unit)
        Set TempPlayer = (Owner of TempUnit)
        For each (Integer A) from 1 to 25, do (Actions)
            Loop - Actions
                Player Group - Remove TempPlayer from TierGroup[(Integer A)]
        Game - Display to PlayersPlaying the text: (PlayerName[(Player number of (Triggering player))] + |cffff0000 has been defeated!!|r)
        Set TempGroup = (Units owned by TempPlayer)
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
                Unit - Remove (Picked unit) from the game
        Custom script:    call DestroyGroup (udg_TempGroup)
        Player Group - Remove TempPlayer from PlayersPlaying
        Player Group - Pick every player in PlayersPlaying and do (Actions)
            Loop - Actions
                Set TempForce = (All players matching ((((Matching player) is an enemy of (Picked player)) Equal to True) and (((Matching player) is in PlayersPlaying) Equal to True)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of players in TempForce) Equal to 0
                    Then - Actions
                        Player Group - Pick every player in (All allies of (Picked player)) and do (Actions)
                            Loop - Actions
                                Game - Victory (Picked player) (Show dialogs, Show scores)
                    Else - Actions
                Custom script:    call DestroyForce (udg_TempForce)

Neither of them work. Could someone please help or write one? I just want it to kill the current units and hero when base dies.
 
Level 6
Joined
Jan 27, 2007
Messages
208
  • Base Gone
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (Your Base)
    • Actions
      • Game - Display to (All players) for 5.00 seconds the text: Base Destroyed
      • Set temp_Group = (Units owned by (Owner of (Dying unit)))
      • Unit Group - Pick every unit in temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup (udg_TempGroup)
maybe this trigger works
 
Status
Not open for further replies.
Top