• 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 Conditions for Custom Races?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
This should work, right?

  • Victory Conditions
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by Player 1 (Red) matching (((Dying unit) is A structure) Equal to True))) Equal to 0
        • Then - Actions
          • Game - Defeat Player 1 (Red) with the message: Defeat!
        • Else - Actions
If this works, I'll change it to Picked Player, so don't worry.

I'm asking because I keep having issues; It defeats Player 1 if a Creep is killed and I think it's because I didn't have this -

  • Conditions
    • (Owner of (Dying unit)) Equal to Player 1 (Red)
But that wouldn't make sense because it's SUPPOSE to be checking for buildings...
 
Level 11
Joined
Nov 15, 2007
Messages
800
Normal melee victory/defeat conditions should work fine. You just need to set the custom race's keep as a keep dependency in Gameplay Constants so the player won't be revealed for not having a keep.
 
Level 12
Joined
May 20, 2009
Messages
822
Normal melee victory/defeat conditions should work fine. You just need to set the custom race's keep as a keep dependency in Gameplay Constants so the player won't be revealed for not having a keep.

I don't remember that actually working. I'll try that real quick and edit this post.

EDIT: No, it doesn't work. xD

Anyway, I think I fixed this. Tell me if this would work.

  • Victory Conditions
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Owner of (Dying unit)) Equal to (Picked player)
                  • (Count structures controlled by (Picked player) (Include incomplete structures)) Equal to 0
            • Then - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
            • Else - Actions
This doesn't reveal players, though. I'm gonna work on that later.
 
Status
Not open for further replies.
Top