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

[Trigger] victory defeat conditions

Status
Not open for further replies.
Level 3
Joined
May 12, 2012
Messages
59
what up people, first post so ill keep it short and to the point. I'm making an alien vs predator map and i cant seem to get victory defeat conditions to work.
i want to make sure that when all units owned by player in group are dead they loose and when all other teams are defeated the remaining team wins.

surprisingly enough none of the long loop triggers or variable triggers i read here seem to work, any suggestions?

Addendum: before the triggers engage the teams select their species and are then moved to the corresponding player group. that part works as advertised
 
Level 3
Joined
May 12, 2012
Messages
59
if i knew how i absolutely would lol, im still learning the ropes for this, but what it is is an event triggered by a unit dying, canceling structure, canceling unit production and then running a condition that all units owned by player of type owner of triggering unit then an if then else set to count the structures owned by the player and if they're zero running the defeat trigger or else do nothing. writing it out doesnt help much i know but like i said i havent figured out how to post a trigger from the map editor:vw_sad: sad i know
 
Level 3
Joined
May 12, 2012
Messages
59
yes there is but only when a face hugger attacks a unit, after a set time then a unit is created but it requires there to be a unit owned by the player attacking it in the first place, and most of the create units in that situation are done with an ability rather then a trigger

Is there a generic "no more units = defeat" trigger i can use to look at out there to just short cut it cause as i said mine isnt working, if i had a reference i could figure it out
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Firstly, try reading some tutorials if you can't make heads or tails in the WE

Secondly, to post a trigger here, click on the trigger you want to post from the list of triggers on the left in the trigger editor then r-click the trigger name in the Trigger Function (Window with the events conditions and action that is under the trigger comment) then select 'Copy as Text' from the menu then paste it here between [trigger]PASTE_HERE[/trigger]

Thirdly, I was asking for respawning to know if I will add the units to a unit group once when the game start but since there is spawning we will need to check the units that spawned and add them to the proper group.

But most importantly, if you don't know how to use the editor well then read some tutorials and if they didn't answer or explained things to you, come here and ask and I will be more than happy to answer.
 
Level 3
Joined
May 12, 2012
Messages
59
actually i just went into the frozen throne scenario folder and stole the defeat conditions of the map monolith, i just said screw it to my trigger and adjusted theirs to suit my needs, now everythings working the way it should. my problem seems to be i was counting all the units of the player group instead of the owner of the unit itself. ill post the trigger so anyone else can see what i did and use it themselves. For the record though ive been using WE since its release, never needed to ask a direct question until the other day, googling usually worked.

  • Check
    • Events
      • Unit - A unit Dies
      • Unit - A unit Cancels construction
      • Unit - A unit Cancels training a unit
    • Conditions
    • Actions
      • Set Init = (Init + (Count structures controlled by (Owner of (Triggering unit)) (Include incomplete structures)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Init Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
        • Else - Actions
          • Do nothing
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well... that trigger just checks if the player has alive structures, else, it looses the game. I would add "Triggering Unit is a Structure Equal To True" so the trigger doesn't have to check every time a unit dies. Also, remove the "Do nothing" action, since it's an action, but does nothing :p Leaving the blank space works better.

I've had never seen this:
"Count structures controlled by (Owner of (Triggering unit)) (Include incomplete structures))"

I'll check later to see how it works.
 
Level 3
Joined
May 12, 2012
Messages
59
Works great

hey tinkered with it after i got the defeat conditions working to make sure the victory conditions work per player group instead of player by player. considering i had to ask how it was done ill post the trigger that i used to decide victory defeat conditions. I set it up to check every time a unit dies because the alien group has the nifty trick of automatically mutating an egg into a new queen larva egg when it dies and i wanted to make sure that there was absolutely no other buildings for the player before it killed em off entirely so that theyd stay in the game until theyre supposed to

  • Check
    • Events
      • Unit - A unit Dies
      • Unit - A unit Cancels construction
      • Unit - A unit Cancels training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Owner of (Dying unit)) is in Aliens) Equal to True
          • ((Owner of (Dying unit)) is in Marines) Equal to True
          • ((Owner of (Dying unit)) is in Predators) Equal to True
    • Actions
      • Wait 0.50 seconds
      • Set Init = (Init + (Count structures controlled by (Owner of (Triggering unit)) (Include incomplete structures)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Init Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
          • Player Group - Remove (Triggering player) from Predators
        • Else - Actions
          • -------- Victory Conditions Below --------
          • -------- Alien --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Number of players in Marines) Equal to 0
                  • (Number of players in Predators) Equal to 0
                  • (Number of players in Aliens) Greater than 0
                  • (Number of players in Aliens) Less than or equal to 3
            • Then - Actions
              • Game - Victory (Player((Number of players in Aliens))) (Show dialogs, Show scores)
            • Else - Actions
              • Do nothing
          • -------- Marine --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Number of players in Aliens) Equal to 0
                  • (Number of players in Predators) Equal to 0
                  • (Number of players in Marines) Greater than 0
                  • (Number of players in Marines) Less than or equal to 3
            • Then - Actions
              • Game - Victory (Player((Number of players in Marines))) (Show dialogs, Show scores)
            • Else - Actions
              • Do nothing
          • -------- Predators --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Number of players in Aliens) Equal to 0
                  • (Number of players in Marines) Equal to 0
                  • (Number of players in Predators) Greater than 0
                  • (Number of players in Predators) Less than or equal to 3
            • Then - Actions
              • Game - Victory (Player((Number of players in Marines))) (Show dialogs, Show scores)
            • Else - Actions
              • Do nothing
Each comment tag represents the player group, it looks like a huge trigger but it checks it three times based off the player group, i wasnt sure about the greater then 0 AND less than equal to 3 trigger but it seems to not like it for me at least when i remove it, theres probably something in some other trigger that screws it up but i dont need to fix that. You may notice all three of these run if the defeat condition is false, if theres an easier way to do it then i didnt see it
 
  • VictoryDefeat Condition
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- ////////////////////////////////////////////////////////////////////////////////// --------
      • -------- These actions will not occur if there is a trigger that spawns a unit for any player --------
      • -------- periodically, because this defeat condition counts number of units of a certain player who is the enemy of the killing unit --------
      • -------- to be sure this will work, you have to destroy of turn off the trigger that spawns a unit for a certain enemy player --------
      • -------- of the killing unit, or to any player playing the game --------
      • -------- ////////////////////////////////////////////////////////////////////////////////// --------
      • -------- ======================================== --------
      • -------- Defeat Condition --------
      • -------- ======================================== --------
      • Set EnemyUnits = (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Dying unit) is in EnemyUnits) Equal to True
              • (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Dying unit)) with the message: Defeat!
        • Else - Actions
      • -------- ======================================== --------
      • -------- Victory Condition --------
      • -------- ======================================== --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (EnemyUnits is empty) Equal to True
        • Then - Actions
          • Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_EnemyUnits)
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
Of course, eubz, it leaks unit group (Units owned by (Owner of (Dying unit)))) Equal to 0 which is hundreds of time, since a different group is created everytime a unit dies. Add a "custom script: set bj_wantDestroy = true" before the conditions.
 
Of course, eubz, it leaks unit group (Units owned by (Owner of (Dying unit)))) Equal to 0 which is hundreds of time, since a different group is created everytime a unit dies. Add a "custom script: set bj_wantDestroy = true" before the conditions.
Yay, haven't really noticed that. I agree largely that unit group there leaks. "wantDestroy" can be used or "call DestroyGroup(udg_EnemyUnits).
 
Level 3
Joined
May 12, 2012
Messages
59
when its done the way i like it ill upload the map, mainly because for the alien group EVERYTHING is an enemy to allow attacking passive to make more drones warriors and attacking kids and small animals to make runners.... dont judge their physically to small to make full on drones, ittl let you guys see what i was working with and against
 
Status
Not open for further replies.
Top