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

If all the heros die trigger

Status
Not open for further replies.
Level 10
Joined
Jul 22, 2008
Messages
363
Okay so in this map this one guy has to kill all the enemy heros. so I know the event trigger: unit dies and action: defeat for... but Im having trouble finding the condition for this specific trigger. Help is always appreciated.:thumbs_up:
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Unit - A Unit dies
  • Conditions
    • Hero1 is alive equal to false
    • Hero2 is alive equal to false
    • Hero3 is alive equal to false
    • Hero4 is alive equal to false
  • ....
  • Actions
    • Defeat your players
create unit variablearray ( Hero[1-x] ) and set the variable to the heros when they are created, if they are already in the map then use them as they are
 
Level 10
Joined
Jul 22, 2008
Messages
363
ok for the variables: 1 I have no clue how to use variables I know how to create but I dont know how to put them into use. 2 is my selection is enter a region and create unit in a different region. So how would I assign the variables with this kind of selection?
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
if you look in your trigger menu there is something that says "set variable"
so create as many variables as you have heroes, use an array if possible, then do:

  • Events
    • Unit - A Unit enters playable map area
  • Conditions
    • triggering unit is a hero equal to true
    • owner of triggering unit not equal to player 9 grey
  • Actions
    • set hero[playernumber of (owner of triggering Unit)] = triggering Unit
i attached a map with both triggers, if you have any problems
 

Attachments

  • variables and multiherodead defeat.w3x
    16.4 KB · Views: 53
Level 10
Joined
Jul 22, 2008
Messages
363
thank you UreDead and thank you Blooddancer. I will try the triggers on your map.

EDIT:
This function cannot be enabled because variable "Hero" does not exist. What does that mean? If that has to do with variables I do not not the variable type that is required.
 
Last edited by a moderator:
Level 10
Joined
Jul 22, 2008
Messages
363
Imma try the variable one first only for the sake that i can understand it.

EDIT:
  • Set hero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
This is fainted but I made the variable array and did what you told me to do whats wrong?
 
Last edited by a moderator:
  • Angry
Reactions: Rui
Level 4
Joined
Sep 18, 2007
Messages
104
Not sure, i'm quite tired at the moment, but I think these triggers would work. Also I am assuming that there are 5 heroes per team.

  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • If (((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True) then do (Set Force1Victory = (Force1Victory + 1)) else do (Set Force2Victory = (Force2Victory + 1))
      • Trigger - Run VictoryDefeat <gen> (checking conditions)
  • VictoryDefeat
    • Events
    • Conditions
      • (Force1Victory Equal to 5) or (Force2Victory Equal to 5)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Force1Victory Equal to 5
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
          • Game - Victory Player 3 (Teal) (Show dialogs, Show scores)
          • Game - Victory Player 4 (Purple) (Show dialogs, Show scores)
          • Game - Victory Player 5 (Yellow) (Show dialogs, Show scores)
          • Game - Defeat Player 6 (Orange) with the message: Defeat!
          • Game - Defeat Player 7 (Green) with the message: Defeat!
          • Game - Defeat Player 8 (Pink) with the message: Defeat!
          • Game - Defeat Player 9 (Gray) with the message: Defeat!
          • Game - Defeat Player 10 (Light Blue) with the message: Defeat!
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Force2Victory Equal to 5
            • Then - Actions
              • Game - Defeat Player 1 (Red) with the message: Defeat!
              • Game - Defeat Player 2 (Blue) with the message: Defeat!
              • Game - Defeat Player 3 (Teal) with the message: Defeat!
              • Game - Defeat Player 4 (Purple) with the message: Defeat!
              • Game - Defeat Player 5 (Yellow) with the message: Defeat!
              • Game - Victory Player 6 (Orange) (Show dialogs, Show scores)
              • Game - Victory Player 7 (Green) (Show dialogs, Show scores)
              • Game - Victory Player 8 (Pink) (Show dialogs, Show scores)
              • Game - Victory Player 9 (Gray) (Show dialogs, Show scores)
              • Game - Victory Player 10 (Light Blue) (Show dialogs, Show scores)
            • Else - Actions
Force1Victory and Force2Victory are both Integer Variables, like I said before, I am not sure if this is the best method.
 
Status
Not open for further replies.
Top