Why does this cause server split (big trigger warning)

Frizz.Meister

New Member
Reaction score
0
Allin the title:

Trigger:
  • RD
    • Events
      • Dialog - A dialog button is clicked for Gamemode_Dialog
    • Conditions
      • (Clicked dialog button) Equal to GamemodeButtons[5]
    • Actions
      • Trigger - Turn off Repick <gen>
      • Set Temp_Group = (Units of type Hero Selecter)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera as necessary for (Picked player) to (Center of rd COP5 <gen>) over 0.01 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Equal to Player 1 (Red)
                • Then - Actions
                  • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP1 <gen>) facing Default building facing degrees
                  • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                  • Selection - Add (Last created unit) to selection for (Picked player)
                  • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked player) Equal to Player 2 (Blue)
                    • Then - Actions
                      • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP2 <gen>) facing Default building facing degrees
                      • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                      • Selection - Add (Last created unit) to selection for (Picked player)
                      • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Picked player) Equal to Player 3 (Teal)
                        • Then - Actions
                          • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP3 <gen>) facing Default building facing degrees
                          • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                          • Selection - Add (Last created unit) to selection for (Picked player)
                          • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked player) Equal to Player 4 (Purple)
                            • Then - Actions
                              • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP4 <gen>) facing Default building facing degrees
                              • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                              • Selection - Add (Last created unit) to selection for (Picked player)
                              • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked player) Equal to Player 5 (Yellow)
                                • Then - Actions
                                  • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP5 <gen>) facing Default building facing degrees
                                  • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                                  • Selection - Add (Last created unit) to selection for (Picked player)
                                  • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Picked player) Equal to Player 6 (Orange)
                                    • Then - Actions
                                      • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP6 <gen>) facing Default building facing degrees
                                      • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                                      • Selection - Add (Last created unit) to selection for (Picked player)
                                      • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Picked player) Equal to Player 8 (Pink)
                                        • Then - Actions
                                          • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP7 <gen>) facing Default building facing degrees
                                          • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                                          • Selection - Add (Last created unit) to selection for (Picked player)
                                          • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Picked player) Equal to Player 9 (Gray)
                                            • Then - Actions
                                              • Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP8 <gen>) facing Default building facing degrees
                                              • Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
                                              • Selection - Add (Last created unit) to selection for (Picked player)
                                              • Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                                            • Else - Actions
            • Else - Actions
      • Game - Display to (All players) the text: Please wait while t...
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 <gen>) facing 270.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 7 <gen>) facing 0.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 4 <gen>) facing 90.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 3 <gen>) facing 180.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 10 <gen>) facing 0.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 11 <gen>) facing 270.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy <gen>) facing 270.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 2 <gen>) facing 180.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 6 <gen>) facing 180.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 5 <gen>) facing 90.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 9 <gen>) facing 90.00 degrees
      • Wait 0.01 seconds
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at (Center of rd HERO1 Copy 8 <gen>) facing 0.00 degrees


Please help as im no good at solving disconnection problems.
 

SGT Vejito

New Member
Reaction score
9
without knowing the premise around what the trigger is meant for I'm not certain of what to switch, however I would suggest these 2 things:

make your wait periods longer, trying to do 12 events within the span of 0.01 of a second can cause a noticeable lag, and could be dropping people without powerful enough computers to run at 0.00083 of a second.

Secondly, i'd change your random integer's from 1-20 to 1-12. You don't need the extra 8 permutations for this particular code.


Those 2 options should help make the trigger a little bit more efficient, hopefully it might resolve the issue of server splits.


EDIT: After looking a bit more at your code I'd suggest altering this part of code


Trigger:
  • * # If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • o * If - Conditions
      • + o (Picked player) Equal to Player 1 (Red)
    • o * Then - Actions
      • + o Unit - Create 1 Hero Selecter for (Picked player) at (Center of rd COP1 <gen>) facing Default building facing degrees
      • + o Unit - Set mana of (Last created unit) to (Random real number between 1.00 and 50.00)
      • + o Selection - Add (Last created unit) to selection for (Picked player)
      • + o Camera - Lock camera target for (Picked player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
    • Else


Lets see if I can explain this properly:

Currently you have a trigger that looks to see if a player slot is used, then checks each player colour 1 after another to do a specific action if that player is playing.

The trouble with your code is for each player it has to search through every if/then/else trigger. For example if the trigger tried to execute for Purple (4) it first has to go through Red, Blue and Teal to get to the Purple Trigger.

the excess amount of calculations going on are probably wreaking havoc as well. I would suggest seperate if/then/else statements, for each player.

It would end up looking something like this:

Trigger:
  • Events
    • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
      • Loop - Actions
        • Camera - Pan camera as necessary for (Picked player) to (Center of rd COP5 <gen>) over 0.01 seconds
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player 1 (Red)) Equal to Is playing
          • Then - Actions
            • (Then Actions Here)
          • Else
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player 2 (Blue)) Equal to Is playing
          • Then - Actions
            • (Then Actions Here)
          • Else
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player 1 (Teal)) Equal to Is playing
          • Then - Actions
            • (Then Actions Here)
          • Else


This way if the trigger needs to find Teal, it dosen't need to check blue and red first, it can just go to Teal.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
And, might also want to clean up some of those leaks there, since they are quite many XD
You started off good by cleaning that first Uni8t Group, but then ... no more :S
These lines leaks:

Code:
Player Group - Pick every player in [COLOR="Red"](All players controlled by a User player)[/COLOR] and do (Actions)

Code:
Camera - Pan camera as necessary for (Picked player) to [COLOR="Red"](Center of rd COP5 <gen>)[/COLOR] over 0.01 seconds

Code:
Unit - Create 1 Hero Selecter for (Picked player) at [COLOR="Red"](Center of rd COP1 <gen>)[/COLOR] facing Default building facing degrees
(Need to clean that up in all the "If"s)

Code:
Unit - Create 1 Hero_Array[(Random integer number between 1 and 20)] for Neutral Passive at [COLOR="Red"](Center of rd HERO1 <gen>)[/COLOR] facing 270.00 degrees

Those should be the lot ;)
 

Romek

Super Moderator
Reaction score
964
Trigger:
  • Camera - Pan camera as necessary for (Picked player) to (Center of rd COP5 &lt;gen&gt;) over 0.01

Pan Camera as Necessary desyncs. Yes, it's retarded.
Change it to "Pan Camera". The normal one.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top