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

[Victory/Defeat] When Farm is Destroyed

Status
Not open for further replies.
Level 7
Joined
Feb 6, 2008
Messages
133
Ok, The Victory/Defeat thingy didnt work.. can someone please help correct this.. i have also attached the map with the triggers

This is what it should do (The Teams are Red and Blue):
- Units Spawning Every (# Seconds), Attacking Each Other Farm And Units (Working Perfectly)
- When Red farm is Destroyed, Blue is Victorious and Red is Defeated (Not Working)
- When Blue farm is Destroyed, Red is Victorious and Blue is Defeated (Not Working)

  • Units Spawn Attack T2
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Grunt for Player 2 (Blue) at (Center of Region 003 <gen>) facing (Position of Farm 0019 <gen>)
      • Unit - Order (Last created unit) to Attack Farm 0019 <gen>
  • Units Spawn Attack T1
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Spell Breaker for Player 1 (Red) at (Center of Region 002 <gen>) facing (Position of Farm 0018 <gen>)
      • Unit - Order (Last created unit) to Attack Farm 0018 <gen>
  • Farm Death T2
  • Victory Defeat
    • Events
      • Unit - Farm 0019 <gen> Dies
      • Unit - Farm 0018 <gen> Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Farm 0018 <gen> is dead) Equal to True
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Defeat Player 2 (Blue) with the message: Defeat!
          • Skip remaining actions
        • Else - Actions
          • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
          • Game - Defeat Player 1 (Red) with the message: Defeat!
          • Skip remaining actions
  • Teleport 1
    • Events
      • Unit - A unit enters teleport 1 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of teleport 1 x <gen>)
      • Animation - Play Blood Mage 0007 <gen>'s spell animation
      • Special Effect - Create a special effect at (Center of teleport 1 <gen>) using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
 

Attachments

  • Test Map Trigger Test 3.w3x
    17.8 KB · Views: 42
Last edited:
Level 11
Joined
Feb 22, 2006
Messages
752
Instead of checking every 5 seconds whether the unit is dead or not, why not just have a trigger detecting when the unit dies?

Also, from the way your trigger is set up, it looks like no matter what, the game will end after 5 seconds, because your periodic event triggers that check to see if the farms are dead will EITHER cause one player or the other to win the first time they check to see if the farms are dead (if the farm is dead, trigger runs actions in the "then" section, if it isn't, it runs actions in the "else" section, which still ends the game).
 
Level 11
Joined
Feb 22, 2006
Messages
752
No offense to whoever showed you those defeat triggers or anything, but next time you see him tell him to learn more about if...then...else blocks (seriously, this isn't a flame, it's good advice).

So your trigger would look something like...

Events

Unit - Farm 0018 Dies
Unit - Farm 0019 Dies

Actions

If ( All Conditions are true ) then do (Then actions) else do (Else actions)
If - Conditions
Farm 0018 is dead equal to True
Then - Actions
Game - Victory Player 1 (Red)
Game - Defeat Player 2 (Blue)
Else - Actions
Game - Victory Player 2 (Blue)
Game - Victory Player 1 (Red)

The trigger will detect when either of the two farms dies. Then if farm 0018 is dead, then it will do victory for red. If farm 0018 isn't dead, then obviously farm 0019 must be dead (because farm 0019's death is the only other thing that could possibly trigger the thread), and so it will do victory for blue.
 
Status
Not open for further replies.
Top