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

King of the Hill Trigger - Cont.

Status
Not open for further replies.
Level 19
Joined
Oct 1, 2008
Messages
1,667
Im making a King of the Hill trigger for my map and am having a few problems with it. I have made some triggers that give wood per second (Instead of a timer) but want this the reset when all units belonging to one team leave the middle area, and am only able to make it reset when one unit leaves...
I think JASS would be needed but Im not sure since... well, I know next to nothing about it...
 
Level 6
Joined
Sep 13, 2008
Messages
261
Ok heres your trigger.

Just copy the actions for each player. The PlayersGroup[x] is a global variable you have to make, I used an array so I wouldn't have to look at so many variables. Don't forget to change out (Entire map) for your region.

  • leave area
    • Events
      • Unit - A unit leaves (Entire map)
    • Conditions
    • Actions
      • Unit Group - Remove (Leaving unit) from PlayersGroup[(Player number of (Owner of (Leaving unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Leaving unit)) Equal to Player 1 (Red)
          • (PlayersGroup[1] is empty) Equal to True
        • Then - Actions
          • Player - Set Player 1 (Red) Current lumber to 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Leaving unit)) Equal to Player 2 (Blue)
          • (PlayersGroup[2] is empty) Equal to True
        • Then - Actions
          • Player - Set Player 2 (Blue) Current lumber to 0
        • Else - Actions
You have to add another trigger that adds the entering unit to the group. And you'll have to change your lumber trigger to use the groups.
 
Last edited:
Status
Not open for further replies.
Top