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

Special Event

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
hello, can someone tell me why this trigger doesn't works in multiplayer? What did I do wrong? when playing single player, this works correctly

  • Special Event 1 Timer Expires
    • Events
      • Time - SpecialEvent_Timer[1] expires
    • Conditions
    • Actions
      • Countdown Timer - Hide (Last created timer window)
      • Countdown Timer - Destroy SpecialEvent_TimerWindow
      • Set Unit_Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Owner of (Picked unit)) Equal to Player 1 (Red)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 2 (Blue)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 3 (Teal)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 4 (Purple)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 6 (Orange)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 7 (Green)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 8 (Pink)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
            • Then - Actions
              • Game - Display to (Player group((Owner of (Picked unit)))) the text: Special Event!
              • Unit - Pause (Picked unit)
            • Else - Actions
      • Wait 3.00 seconds
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 1 (Red)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 1 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 1 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 2 (Blue)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 2 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 2 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 3 (Teal)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 3 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 3 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 4 (Purple)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 4 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 4 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 5 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 5 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 6 (Orange)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 6 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 6 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 7 (Green)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 7 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 7 Special Event <gen>)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 8 (Pink)) and ((((Picked unit) is paused) Equal to True) and (((Picked unit) is A Hero) Equal to True))
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across Special Event <gen>
              • Visibility - Enable (Last created visibility modifier)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Player 8 Special Event <gen>) over 0.00 seconds
              • Unit - Move (Picked unit) instantly to (Center of Player 8 Special Event <gen>)
            • Else - Actions
      • Set Arrrggghhhh = Aarggghhhh
      • Unit - Create 1 Arrrggghhhh for Player 12 (Brown) at (Center of Special Event <gen>) facing 180.00 degrees
      • Set Arrrggghhhh_unit = (Last created unit)
      • Hero - Modify Strength of Arrrggghhhh_unit: Add 100000
      • Hero - Modify Agility of Arrrggghhhh_unit: Add 100000
      • Hero - Modify Intelligence of Arrrggghhhh_unit: Add 100000
      • Unit - Pause Arrrggghhhh_unit
      • Wait 3.00 seconds
      • Set TempGroup = (Units in Paused Creeps <gen>)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Wait 3.00 seconds
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Owner of (Picked unit)) Equal to Player 1 (Red)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 2 (Blue)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 3 (Teal)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 4 (Purple)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 6 (Orange)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 7 (Green)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 8 (Pink)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
            • Then - Actions
              • Game - Display to (Player group((Owner of (Picked unit)))) the text: Try to survive the ...
            • Else - Actions
      • Wait 3.00 seconds
      • Unit Group - Pick every unit in (Units in Special Event <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
      • Countdown Timer - Start SpecialEvent_Cooldown[1] as a One-shot timer that will expire in 120.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Cooldown:
      • Set SpecialEvent_CooldownWindow = (Last created timer window)
      • Countdown Timer - Show SpecialEvent_CooldownWindow for (Owner of (Entering unit))
      • Trigger - Turn on Special Event 1 Dying hero <gen>
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
There are SOOOOOOOOOO many reasons for this not to work :')

If you use in any other trigger any of the variables you use here (Like the Unit_Group) the trigger will malfunction, since you're replacing the variable value with something else. So, those "Wait" actions may screw everything up.

You have MANY leaks. You have MANY things to improve. You use SO MANY repetitive callings that my eyes bleed.

I tried to do my best improving the trigger, but got tired before ending. Anyway, you may notice how the trigger size is greatly reduced, and how variables are used to avoid repetitive callings (With "Repetitive callings i mean using (Picked Unit) a hundred times. You have to know that parentheses are evil and you have to reduce them as much as possible).


  • Special Event 1 Timer Expires
    • Events
      • Time - SpecialEvent_Timer[1] expires
    • Conditions
    • Actions
      • Set Region[1] = Player 1 Special Event <gen>
      • Set Region[2] = Player 2 Special Event <gen>
      • Set Region[3] = Player 3 Special Event <gen>
      • Set Region[4] = Player 4 Special Event <gen>
      • Set Region[5] = Player 5 Special Event <gen>
      • Set Region[6] = Player 6 Special Event <gen>
      • Set Region[7] = Player 7 Special Event <gen>
      • Set Region[8] = Player 8 Special Event <gen>
      • Countdown Timer - Hide (Last created timer window)
      • Countdown Timer - Destroy SpecialEvent_TimerWindow
      • Set Unit_Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set u = (Picked Unit)
          • Set p = (Owner of u)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player number of p) is less than or equal to 8)
              • ((u is A Hero) equal to True))
              • ((u belongs to an Ally of Player 11 (Dark Green) Equal to True)
            • Then - Actions
              • Set f = (Player group(p))
              • Game - Display to f the text: Special Event!
              • Custom script: call DestroyForce(udg_f)
              • Unit - Pause u
            • Else - Actions
              • Unit Group - Remove u from Unit_Group
      • Wait 3.00 seconds
      • For Each Integer A from 1 to 8 do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player(Integer A) emitting Visibility across Special Event <gen>
          • Visibility - Enable (Last created visibility modifier)
          • Camera - Pan camera for Player(Integer A) to Region[(Integer A)] over 0.00 seconds
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set u = (Picked Unit)
          • Set Point = (Center of Region[(Player number of (Owner of u))]
          • Unit - Move u instantly to Point
          • Custom script: call RemoveLocation(udg_Point)
            • Else - Actions
      • Set Arrrggghhhh = Aarggghhhh
      • Unit - Create 1 Arrrggghhhh for Player 12 (Brown) at (Center of Special Event <gen>) facing 180.00 degrees
      • Set Arrrggghhhh_unit = (Last created unit)
      • Hero - Modify Strength of Arrrggghhhh_unit: Add 100000
      • Hero - Modify Agility of Arrrggghhhh_unit: Add 100000
      • Hero - Modify Intelligence of Arrrggghhhh_unit: Add 100000
      • Unit - Pause Arrrggghhhh_unit
      • Wait 3.00 seconds
      • Set TempGroup = (Units in Paused Creeps <gen>)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Wait 3.00 seconds
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Owner of (Picked unit)) Equal to Player 1 (Red)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 2 (Blue)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 3 (Teal)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 4 (Purple)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 6 (Orange)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 7 (Green)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
                  • ((Owner of (Picked unit)) Equal to Player 8 (Pink)) and ((((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True))
            • Then - Actions
              • Game - Display to (Player group((Owner of (Picked unit)))) the text: Try to survive the ...
            • Else - Actions
      • Wait 3.00 seconds
      • Unit Group - Pick every unit in (Units in Special Event <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
      • Countdown Timer - Start SpecialEvent_Cooldown[1] as a One-shot timer that will expire in 120.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Cooldown:
      • Set SpecialEvent_CooldownWindow = (Last created timer window)
      • Countdown Timer - Show SpecialEvent_CooldownWindow for (Owner of (Entering unit))
      • Trigger - Turn on Special Event 1 Dying hero <gen>


It's better if you tell us what do you exactly want to achieve so we can help you.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Your trigger has flaws everywhere. Let me (us) know what you want to achieve with this and we'll show you a better way to do it, and you can learn in the meanwhile.
 
Status
Not open for further replies.
Top