• 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.

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