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

Triggering Help

Status
Not open for further replies.
Level 5
Joined
Jul 13, 2010
Messages
84
Hello, I am working on my map and I am trying to make triggers that ensue after 6 duels have completed.
The six duels all happen at the same time and when each duel is finished players from the red side spawn in their new base and the blue team theirs.
How do I trigger it so that after all 6 duels are done that wisps spawn to vote on the next event?
Ty & +rep to whoever helps me :)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) You could create a variable to count the duels done.
Create an integer variable (called "duelsComplete" or something), set it to 0 when the duels begin and every time a duel ends, increase it by 1. When it reaches 6, then you could go on with the next event.

2) You could count the units for one of the spawns. Apparently there should be 6 units in each spawn, so you can create a unit group variable, set the variable to all units in one of the spawns and count them. If there are 6, commence the voting.
(You should only count one of the spawns: if one is 5, the other will always be 5 as well, because the remaining unit of each team is in a duel).

I highly suggest the first solution.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
You need a system to keep track of the duels.

When a duel is lost or won, it ends and thus runs a respawn routein for the involved players (that deals with the correct spawn places).
When no more duels are running (all active duels end), then you spawn the wisps.

Do remember that players can drop for retarded reasons. Make sure that people who drop instantly "lose" or are controlable by an active player to prevent the game entering a unable to progress state. A simple example could be if both people drop during a duel at opposite ends of the arena where they may not auto engauge, there must be some way for the dual to progress or end.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set duelsComplete = (duelsComplete + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) is in {Team 1}) Equal to True
        • Then - Actions
          • Set team2Wins = (team2Wins + 1)
          • Set Loc1 = (Center of {Team 1 Spawn})
          • Set Loc2 = (Center of {Team 2 Spawn})
        • Else - Actions
          • Set team1Wins = (team1Wins + 1)
          • Set Loc1 = (Center of {Team 2 Spawn})
          • Set Loc2 = (Center of {Team 1 Spawn})
      • Hero - Instantly revive (Triggering unit) at Loc1, Hide revival graphics
      • Unit - Move (Killing unit) instantly to Loc2
      • Custom script: call RemoveLocation(udg_Loc1)
      • Custom script: call RemoveLocation(udg_Loc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • duelsComplete Equal to 6
        • Then - Actions
          • -------- Create wisps --------
        • Else - Actions
That would be an easy example.

Let me explain it to you:
Everything between these brackets: {} means that it's some variable or region for your map and you must change it according to what you have.

First we increment duelsComplete by 1 (this will later on be checked to see whether 6 duels are over or not).
I do this first because it's a habit of mine: change the variables first, then do the actions.

Now we check if the triggering ( = dying) unit is in Team 1 (the {} brackets mean that you must have some kind of variable to check which players are in which team).
If that's true, then Team 2 won the duel.
We set the locations to the respective team spawn (used for later).
We do the same if Team 1 won (the else-part of the if-then-else).

And then we actually move the units: we revive the dead hero (I assume they're heroes?) and move the winning one to the locations we set before (in the if-then-else).
The custom scripts are to remove leaks (lowers lag probability).

And then we check if duelsComplete is 6, if it is: do your wisp-event-trigger.


Do remember that players can drop for retarded reasons. Make sure that people who drop instantly "lose" or are controlable by an active player to prevent the game entering a unable to progress state. A simple example could be if both people drop during a duel at opposite ends of the arena where they may not auto engauge, there must be some way for the dual to progress or end.
This is an important thing he pointed out.
Also counts for when it's not a full house, or the player dropped before the duel.
 
Status
Not open for further replies.
Top