• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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
781
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