• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] How to properly build a trigger that ends a duel round

Level 3
Joined
Feb 12, 2020
Messages
35
Hi there,

I'm working on a custom map where multiple 1 v 1 duels are fought at the same time. Most of the game functions well, except for one thing.

I have a trigger that ends a round:

  • S1 Kill Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set VariableSet TempMatch = 0
      • Set VariableSet TempPN = 0
      • Set VariableSet TempOwnernumber = (Player number of (Owner of (Triggering unit)))
      • -------- combat unit 9-16 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempOwnernumber Greater than or equal to 9
          • TempOwnernumber Less than or equal to 16
        • Then - Actions
          • Set VariableSet TempPN = (TempOwnernumber - 8)
          • Set VariableSet TempMatch = Player_MatchIndex[TempPN]
        • Else - Actions
          • Do nothing
      • -------- ghost combat unit P19 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempOwnernumber Equal to 19
        • Then - Actions
          • Set VariableSet TempMatch = GhostTargetMatchIndex
        • Else - Actions
          • Do nothing
      • -------- alleen doorgaan als deze unit bij een actieve match hoort --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempMatch Greater than or equal to 1
          • TempMatch Less than or equal to 4
          • ArenaResolved[TempMatch] Equal to False
        • Then - Actions
          • -------- side a unit died --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempPN Equal to ArenaSideAPlayer[TempMatch]
            • Then - Actions
              • Set VariableSet TempGroup = (Units in MatchRegion[TempMatch] matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to (Player(TempOwnernumber)))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempGroup) Equal to 0
                • Then - Actions
                  • Set VariableSet ArenaWinner[TempMatch] = ArenaSideBPlayer[TempMatch]
                  • Set VariableSet ArenaLoser[TempMatch] = ArenaSideAPlayer[TempMatch]
                  • Set VariableSet ArenaResolved[TempMatch] = True
                  • Set VariableSet ResolvedMatchCount = (ResolvedMatchCount + 1)
                  • Trigger - Run S1B Match Resolved <gen> (checking conditions)
                • Else - Actions
                  • Do nothing
              • Custom script: call DestroyGroup(udg_TempGroup)
            • Else - Actions
              • Do nothing
          • -------- side b player unit died --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArenaResolved[TempMatch] Equal to False
              • TempPN Equal to ArenaSideBPlayer[TempMatch]
              • ArenaSideBIsGhost[TempMatch] Equal to False
            • Then - Actions
              • Set VariableSet TempGroup = (Units in MatchRegion[TempMatch] matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to (Player(TempOwnernumber)))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempGroup) Equal to 0
                • Then - Actions
                  • Set VariableSet ArenaWinner[TempMatch] = ArenaSideAPlayer[TempMatch]
                  • Set VariableSet ArenaLoser[TempMatch] = ArenaSideBPlayer[TempMatch]
                  • Set VariableSet ArenaResolved[TempMatch] = True
                  • Set VariableSet ResolvedMatchCount = (ResolvedMatchCount + 1)
                  • Trigger - Run S1B Match Resolved <gen> (checking conditions)
                • Else - Actions
              • Custom script: call DestroyGroup(udg_TempGroup)
            • Else - Actions
              • Do nothing
          • -------- side b ghost unit died --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArenaResolved[TempMatch] Equal to False
              • TempOwnernumber Equal to 19
              • ArenaSideBIsGhost[TempMatch] Equal to True
            • Then - Actions
              • Set VariableSet TempGroup = (Units in MatchRegion[TempMatch] matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 19 (Mint))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempGroup) Equal to 0
                • Then - Actions
                  • Set VariableSet ArenaWinner[TempMatch] = ArenaSideAPlayer[TempMatch]
                  • Set VariableSet ArenaLoser[TempMatch] = 0
                  • Set VariableSet ArenaResolved[TempMatch] = True
                  • Set VariableSet ResolvedMatchCount = (ResolvedMatchCount + 1)
                  • Trigger - Run S1B Match Resolved <gen> (checking conditions)
                • Else - Actions
              • Custom script: call DestroyGroup(udg_TempGroup)
            • Else - Actions
              • Do nothing
        • Else - Actions
          • Do nothing
When testing the game, it sometimes doesn't trigger after the last unit of a player dies. I tested it with units that summon units, but that doesn't seem to be the factor here. Anyone knows how to make with waterproof?

Also, if anyone has a better way to trigger this trigger than to have it trigger by the kill event, please let me know.

Thanks!
 
Back
Top