• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

King of the Hill check trigger solution??

Status
Not open for further replies.
I have this triigger that is supposed to check every second, is a player in the region 'Hill' alone (there are no enemy players also inside of it).

and if so, score points for the player.
But it's not working and I have no idea what else to do to make it work.

  • KOTH Periodiic
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set KOTH_Gr = (Units in Hill <gen> matching (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((Owner of (Matching unit)) Not equal to Neutral Passive)))
      • Unit Group - Pick every unit in KOTH_Gr and do (Actions)
        • Loop - Actions
          • Set TempPlayer = (Owner of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Score_KOTHChecked[(Player number of TempPlayer)] Equal to False
            • Then - Actions
              • -------- ------------------------------------ --------
              • Set KOTHGrCheckFriends = (Units in Hill <gen> matching (((Owner of (Matching unit)) is an ally of TempPlayer) Equal to True))
              • Set KOTHGrCheckEnemies = (Units in Hill <gen> matching (((Owner of (Matching unit)) is an enemy of TempPlayer) Equal to True))
              • -------- ------------------------------------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in KOTHGrCheckEnemies) Equal to 0
                • Then - Actions
                  • Set TempPlayer = (Owner of (Picked unit))
                  • Set Score_KOTH[(Player number of TempPlayer)] = (Score_KOTH[(Player number of TempPlayer)] + 50)
                  • Leaderboard - Change the value for TempPlayer in ExtraModeLeaderboard to Score_KOTH[(Player number of TempPlayer)]
                  • Leaderboard - Sort ExtraModeLeaderboard by Value in Descending order
                  • -------- ------------------------------------ --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Score_KOTH[(Player number of TempPlayer)] Equal to 10000
                    • Then - Actions
                      • Player Group - Pick every player in (All allies of TempPlayer) and do (Actions)
                        • Loop - Actions
                          • Game - Victory (Picked player) (Show dialogs, Show scores)
                      • Player Group - Pick every player in (All enemies of TempPlayer) and do (Actions)
                        • Loop - Actions
                          • Game - Defeat (Picked player) with the message: Defeat!
                    • Else - Actions
                • Else - Actions
              • Set Score_KOTHChecked[(Player number of TempPlayer)] = True
            • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Score_KOTHChecked[(Player number of TempPlayer)] = False
      • Custom script: call DestroyGroup(udg_KOTHGrCheckFriends)
      • Custom script: call DestroyGroup(udg_KOTHGrCheckEnemies)
      • Custom script: call DestroyGroup(udg_KOTH_Gr)
 
I don't know where is the problem, but I must point:

  1. Is every second or every 5 seconds?
  2. This must be inside the If/Then/Else
    • Custom script: call DestroyGroup(udg_KOTHGrCheckFriends)
    • Custom script: call DestroyGroup(udg_KOTHGrCheckEnemies)
  3. Why you use this condition?
    • Score_KOTHChecked[(Player number of TempPlayer)] Equal to False
    If later you have this:
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set Score_KOTHChecked[(Player number of TempPlayer)] = False
  4. You didn't even use this variable:
    • Set KOTHGrCheckFriends = (Units in Hill <gen> matching (((Owner of (Matching unit)) is an ally of TempPlayer) Equal to True))
  5. You must use
    • Set TempInt = (Player number of TempPlayer)
  6. Is necessary have this inside the Unit group loop?
    • Leaderboard - Sort ExtraModeLeaderboard by Value in Descending order
 
  • KOTH Periodiic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set KOTH_Gr = (Units in Hill <gen> matching (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((Owner of (Matching unit)) Not equal to Neutral Passive)))
      • Unit Group - Pick every unit in KOTH_Gr and do (Actions)
        • Loop - Actions
          • Set TempPlayer = (Owner of (Picked unit))
          • Set TempInt = (Player number of TempPlayer)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Score_KOTHChecked[TempInt] Equal to False
            • Then - Actions
              • -------- ------------------------------------ --------
              • Set KOTHGrCheckEnemies = (Units in Hill <gen> matching (((Owner of (Matching unit)) is an enemy of TempPlayer) Equal to True))
              • -------- ------------------------------------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in KOTHGrCheckEnemies) Equal to 0
                • Then - Actions
                  • Set Score_KOTH[TempInt] = (Score_KOTH[TempInt] + 50)
                  • Leaderboard - Change the value for TempPlayer in ExtraModeLeaderboard to Score_KOTH[TempInt]
                  • -------- ------------------------------------ --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Score_KOTH[TempInt] Equal to 10000
                    • Then - Actions
                      • Player Group - Pick every player in (All allies of TempPlayer) and do (Actions)
                        • Loop - Actions
                          • Game - Victory (Picked player) (Show dialogs, Show scores)
                      • Player Group - Pick every player in (All enemies of TempPlayer) and do (Actions)
                        • Loop - Actions
                          • Game - Defeat (Picked player) with the message: Defeat!
                    • Else - Actions
                • Else - Actions
              • Set Score_KOTHChecked[TempInt] = True
              • Custom script: call DestroyGroup(udg_KOTHGrCheckEnemies)
            • Else - Actions
      • Leaderboard - Sort ExtraModeLeaderboard by Value in Descending order
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Score_KOTHChecked[(Player number of TempPlayer)] = False
      • Custom script: call DestroyGroup(udg_KOTH_Gr)
still not working. his SCORE does not change at all. When i test..
 
Status
Not open for further replies.
Back
Top