• 🏆 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!

help needed with victory conditions

Status
Not open for further replies.
Level 2
Joined
Feb 6, 2012
Messages
14
Hi i am working on a college project on warcraft 3 editor...i need help with setting victory conditions. This is 1v1 game... where the players can build 2 types of structure..like a townhall and a watch tower..we havent decided on the 2 types of structure..i need help with setting victory conditions to the player who destroys all the towers of the opponent team first wins..i have tried a lot of trigger..that made sense to me but nothing is working out...i am sure i am not doing the right thing..but can some one help me...??
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Hi i am working on a college project on warcraft 3 editor...i need help with setting victory conditions. This is 1v1 game... where the players can build 2 types of structure..like a townhall and a watch tower..we havent decided on the 2 types of structure..i need help with setting victory conditions to the player who destroys all the towers of the opponent team first wins..i have tried a lot of trigger..that made sense to me but nothing is working out...i am sure i am not doing the right thing..but can some one help me...??

Well a simplified way of doing this is adding the towers of a player to a group and then check if the group is empty or not. If it is then that player has no towers left -> defeat for that player and victory for the other player.

Just make sure that at start the group is not completely empty untill the first tower has been build. Add something like a dummy unit to the group and remove it when the first tower is build so that the victory condition won't evaluate at the start of the game.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Not equal to (Triggering player)))))) Equal to 0
        • Then - Actions
          • Wait 5.00 seconds
          • Game - Victory (Triggering player) (Show dialogs, Show scores)
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Equal to (Triggering player)))))) Equal to 0
        • Then - Actions
          • Wait 5.00 seconds
          • Game - Defeat (Triggering player) with the message: Defeat!
        • Else - Actions
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Not equal to (Triggering player)))))) Equal to 0
        • Then - Actions
          • Wait 5.00 seconds
          • Game - Victory (Triggering player) (Show dialogs, Show scores)
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Equal to (Triggering player)))))) Equal to 0
        • Then - Actions
          • Wait 5.00 seconds
          • Game - Defeat (Triggering player) with the message: Defeat!
        • Else - Actions

Or this ofcourse ^.^
Why is the wait there b.t.w.? Not that it matters, but still...
Isn't it better to immediately show a victory or defeat when they get destroyed?
 
Status
Not open for further replies.
Top