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

2 Triggers

Status
Not open for further replies.
Level 4
Joined
Dec 6, 2007
Messages
78
I need help with a couple of triggers that I can't seem to figure out or get right.

Primarily, I need a trigger that when turned on, counts the lumber of Team 1 and Team 2. And if Team 1 has the most combined lumber, then activate a "Team 1 Win" trigger and a "Team 2 Lose" trigger, and vise versa.

The second one is a bit more simple. I was wondering if its possible to revive a unit (in the exact same spot it died) that isn't a hero and without having to use the Reincarnation ability, as I've tried and for some reason it doesn't work.

Help would be appreciated. :)

EDIT: Just so you know, players 1 through 4 are on Team 1, and players 5 through 8 are on Team 2. And the NPC controlled team that supplies lumber through bounty is player 9.
 
Last edited:
Level 5
Joined
Nov 12, 2007
Messages
134
First Trigger:
  • Lumber
    • Events
    • Conditions
    • Actions
      • -------- I'm assuming that Player 1 (Red) is an ally of Team 1 and Player 7 (Green) is an ally of Team 2 --------
      • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Set TeamLumber[1] = (TeamLumber[1] + ((Picked player) Current lumber)))
      • Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Set TeamLumber[2] = (TeamLumber[2] + ((Picked player) Current lumber)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TeamLumber[1] Greater than TeamLumber[2]
        • Then - Actions
          • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Game - Victory (Picked player) (Show dialogs, Show scores))
          • Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Game - Defeat (Picked player) with the message: Defeat!)
        • Else - Actions
          • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Game - Defeat (Picked player) with the message: Defeat!)
          • Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Game - Victory (Picked player) (Show dialogs, Show scores))
Second Trigger:
  • Revival
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to False
    • Actions
      • Wait 3.00 seconds
      • -------- Optional Wait --------
      • Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Dying unit)) at (Position of (Dying unit)) facing (Facing of (Dying unit)) degrees
Only problem is that if your unit has items, they won't be back.
 
Level 8
Joined
Dec 29, 2006
Messages
359
  • Check Team Lumber
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) Current lumber) Greater than (Player 2 (Blue) Current lumber)
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) Current lumber) Greater than (Player 1 (Red) Current lumber)
        • Then - Actions
          • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
        • Else - Actions
Just use the Trigger-Run action when you want to use this.
 
Level 5
Joined
Nov 12, 2007
Messages
134
  • Check Team Lumber
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) Current lumber) Greater than (Player 2 (Blue) Current lumber)
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) Current lumber) Greater than (Player 1 (Red) Current lumber)
        • Then - Actions
          • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
        • Else - Actions
Just use the Trigger-Run action when you want to use this.

This will only detect Red's and Blue's lumber and not the whole teams...
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Primarily, I need a trigger that when turned on, counts the lumber of Team 1 and Team 2. And if Team 1 has the most combined lumber, then activate a "Team 1 Win" trigger and a "Team 2 Lose" trigger, and vise versa.

  • Which Team Has More Lumber
    • Events
    • Conditions
    • Actions
      • Set Team1Lumber = (Team 1 Player 1) Current lumber) + (Team 1 Player 2) Current lumber)....
      • Set Team2Lumber = (Team 2) Current lumber) + (Team 2 Player 2) Current lumber)....
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Team1Lumber Greater than Team2Lumber
        • Then - Actions
          • Trigger - Run Team 1 Win Team 2 Loss <gen> (checking conditions)
        • Else - Actions
          • Trigger - Run Team 2 Win Team 1 <gen> (checking conditions)
  • Team 1 Win Team 2 Loss
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (Team 1) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked Player) (Show dialogs, Show scores)
      • Player Group - Pick every player in (Team 2) and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked Player) with the message: Less lumber!
The other trigger would be vice versa....
 
Last edited:
Level 4
Joined
Dec 6, 2007
Messages
78
Thanks a lot you guys. I tested the lumber count one and it works great. Only I forgot to be a bit more specific with the 2nd trigger. There's 48 of their unit type, and 48 small regions they are confined to. Their fly height is -100 but when I use a trigger that creates a new one when one of them dies, instead of reviving the same one, it comes out with the fly height 0. So I tried adding an Action to change it fly height to -100 when it spawns but it still doesn't work. So since that didn't work, I just tried reviving the same unit when it died with Reincarnation, but somehow it didn't activate. So then I tried reviving it with a trigger, but it didn't work either and I can't seem to figure out why. I'm wondering if there's any solution to this. These are the 2 I tried using, none of which worked.

  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Example
    • Actions
      • Unit - Create 1 Example for Player 9 (Gray) at (Position of (Dying unit)) facing 270.00 degrees
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Example
    • Actions
      • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
 
Last edited:
Status
Not open for further replies.
Top