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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top