• 🏆 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] [Help Needed]Victory Trigger

Status
Not open for further replies.
Level 5
Joined
Nov 13, 2007
Messages
99
Hi I need help for my map. My map consist of two teams fighting each other and the last remaining team lives. So its:
Team 1:
red,blue,teal,purp,yellow
Team2:
orange, Green, Pink, grey, Light blue

I tried using this trigger and it cause me to have the display of defeat when I try to test the map out.

Event:Time - Every 30.00 seconds of game time
Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (If (((Triggering unit) is in (Units in (Playable map area))) Equal to True) then do (Do nothing) else do (Melee Game - Enforce victory/defeat conditions (for all players)))

But when my friend told me to use this:
Event:Time - Every 30.00 seconds of game time
Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (If (((Triggering unit) is in (Units in (Playable map area))) Equal to True) then do (Do nothing) else do (Game - Victory Player 1 (Red) (Show dialogs, Show scores)))

It worked, I mean like it won't show me the defeat sign. But in 30secs later it appeared a Victory sign for me. I would want the trigger for like when a team kills the other team and the team that is still living to have the victory sign. Sorry If it is a little confusing. You can reach me at layzab0ne on AIM. If you need the map or could help me out please tell me. Thanks~!
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Untitled Trigger 008
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Heros_Alive[1] = (Number of players in (All players matching ((((Matching player) is an ally of Player 1 (Red)) Equal to True) and (((Matching player) slot status) Equal to Is playing))))
      • Set Heros_Alive[2] = (Number of players in (All players matching ((((Matching player) is an enemy of Player 1 (Red)) Equal to True) and (((Matching player) slot status) Equal to Is playing))))
  • Untitled Trigger 007
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Heros_Alive[1] = (Heros_Alive[1] - 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) belongs to an enemy of Player 1 (Red)) Equal to True
            • Then - Actions
              • Set Heros_Alive[2] = (Heros_Alive[2] - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heros_Alive[1] Equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heros_Alive[2] Equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
No, this is already for all players, notice that "Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)".

This trigger makes an integer that has the value of all players playing on team 1 (allies of red) and all players playing on team 2 (enemies of red).

Now whenever a hero dies from a team it decreases the integer of that team.

When one of the integers become zero, that team loses and the other one wins.
 
Level 5
Joined
Nov 13, 2007
Messages
99
No, this is already for all players, notice that "Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)".

This trigger makes an integer that has the value of all players playing on team 1 (allies of red) and all players playing on team 2 (enemies of red).

Now whenever a hero dies from a team it decreases the integer of that team.

When one of the integers become zero, that team loses and the other one wins.

Oh I see. Ill just do the whole thing thanks!!Well, i could just keep talking to u here than AIM lol as long as u go on =) thanks!,
 
Level 5
Joined
Nov 13, 2007
Messages
99
Its so hard I cant follow...Im sorry. I cant find ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
and Set Heros_Alive[1] = (Number of players in (All players matching ((((Matching player) is an ally of Player 1 (Red)) Equal to True) and (((Matching player) slot status) Equal. Im so sorry,.
 
Level 5
Joined
Nov 13, 2007
Messages
99
No, this is already for all players, notice that "Player Group - Pick every player in (All enemies of Player 1 (Red)) and do (Actions)".

This trigger makes an integer that has the value of all players playing on team 1 (allies of red) and all players playing on team 2 (enemies of red).

Now whenever a hero dies from a team it decreases the integer of that team.

When one of the integers become zero, that team loses and the other one wins.

Oh I get it lol!!!but I tried so much times and Im a newbie in variables so I don't know what to do. Could someone help me do it?

The first 2 are Boolean Conditions
The 3rd one is a player status condition.

Yea I know but the variables are hard. Help please.
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Oh I get it lol!!!but I tried so much times and Im a newbie in variables so I don't know what to do. Could someone help me do it?



Yea I know but the variables are hard. Help please.

Here is a small example how how variables work.
Event
A guy eats taco.
Condition
Action
If, then, else Condition
If
Value of taco_left = 1 or more.
Then - Actions
Eat more tacos.
Set taco_left = taco_left - 1
Else - Actions
Buy more tacos.
Set taco_left = taco_left + 5

taco_left is an Integer variable which in this case tells how much taco(s) are left.
 
Level 5
Joined
Nov 13, 2007
Messages
99
errrrr ok....so therefore, in the umm set heros alive, for the variable, I just like 1) create a variable-Hero_live-integer-then press ok. lol then thats a new variable. Now what I do?
-and uhh im in 9th lol im just confused with WE's stuff. lol
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Naw, they're the same - a name/letter/etc used to represent a value.

Not really, you just learn integers and reals, and you cant possibly call using x and y in some math eqou's learning how to use variables.

errrrr ok....so therefore, in the umm set heros alive, for the variable, I just like 1) create a variable-Hero_live-integer-then press ok. lol then thats a new variable. Now what I do?
-and uhh im in 9th lol im just confused with WE's stuff. lol

Use the "Set Variable" action (third one I think).
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Not really, you just learn integers and reals, and you cant possibly call using x and y in some math eqou's learning how to use variables.
A variable is not a type. A variable is the abstract representation of a value >_>

Wikipedia said:
In computer science and mathematics, a variable (pronounced /ˈveərɪəbl/) (sometimes called an object or identifier in computer science) is a symbolic representation used to denote a quantity or expression. In mathematics, a variable often represents an "unknown" quantity that has the potential to change; in computer science, it represents a place where a quantity can be stored. Variables are often contrasted with constants, which are known and unchanging.
Not only are the definitions they give for the two similar, but often in math you also use a variable for shorthand purposes; it is a place where a quantity can be stored.


Anyways, to write to variables, you can use the 'Set Variable' action (something like the 8th one actually, ghost :p), as GhostWolf suggested. To read from variables (in an appropriate situation), you will notice an option in any field pertaining to an action to use variables of a type which fits into such a field (So if you, for example, had an Integer called LifeRemaining, and wanted to set a unit's life to it, you would use the Unit - Set Life command, and then under Life you would look for the variable LifeRemaining in the Variables list).
 
Level 1
Joined
Dec 10, 2007
Messages
3
Your triggers here

Here's the survival mode with 5 lifes per player *No dg or brown*

Edit: Added your Victory Triggers * I think they work* lol
 

Attachments

  • Survival Mode Triggers.w3x
    21.5 KB · Views: 45
Last edited:
Status
Not open for further replies.
Top