• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Need Help with Disconnects

Status
Not open for further replies.
Level 9
Joined
Jun 25, 2009
Messages
427
When i'm playing 5x5 on my map after some time almost everyone gets disconnected? what is the problem (is it leaks????)? and if you know what can be wrong could you tell me how to fix it (a sollution or something):grin:
 
Link to the map or send the file to [email protected] and I'll take a look at your code and see if I can offer you some ways to reduce disconnects.

Wouldn't it be smarter to simply use the paste bin instead of bringing emails into this? (Go to paste bin, post a new entry with your map on it, copy the address when its posted up and then pm bribe the address. Paste bin is for things like this, when you want to give someone a resource without putting it up where everyone can see it)
 
Let me break down one of your triggers for you (hard parts loop)

You have a trigger that gets turned on (if a unit is attacked) and when it's on it loops every 0.05 seconds of game time.

Immediately, this is a trigger to watch out for - one that happens a lot! And therein lies a very huge problem on your map
  • Hard Parts Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • [I][U][B]Set KB_unit_pos = (Position of KB_Unit)[/B]
      • [B]Set KB_point = (KB_Point_Old offset by (KB_Range / 15.00) towards ((Facing of KB_Unit) + 180.00) degrees)[/B]
  • [/U][/I] Unit - Move KB_Unit instantly to KB_point
    • Special Effect - Create a special effect at KB_unit_pos using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
    • Special Effect - Destroy (Last created special effect)
    • [I][U][B]Set KB_Point_Old = KB_point[/B]
  • [/U][/I] Set KB_RangeLeft = (KB_RangeLeft - (KB_Range / 15.00))
    • Destructible - Pick every destructible within 125.00 of KB_Point_Old and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
          • Then - Actions
            • Destructible - Kill (Picked destructible)
          • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • KB_RangeLeft Less than or equal to 0.00
      • Then - Actions
        • Unit - Unpause KB_Unit
        • Trigger - Turn off (This trigger)
        • Trigger - Turn on Hard Parts <gen>
        • Set KB_Range = 0.00
        • Set KB_RangeLeft = 0.00
        • Set KB_Dmg = 0.00
        • Set KB_Unit = No unit
        • [B] [U][I]Custom script: call RemoveLocation(udg_KB_unit_pos)
          • Custom script: call RemoveLocation(udg_KB_point)
          • Custom script: call RemoveLocation(udg_KB_Point_Old)
  • [/I][/U][/B] Else - Actions
OK notice your point locations (I emphasized them) in the first part of the trigger - they have no if/then/else function so they will fire EVERY 0.05 seconds of game time. The second part of the trigger if within an if/then/else function, and i bolded your "Destroy point" functions -- guess what? every time that if/then/else function returns false you're going to get point location leaks! (A lot!). Put your destroy point functions *outside* of your if/then/else function so that the points are destroyed no matter the circumstances. Here's how I recommend this one trigger is fixed:

  • Hard Parts Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set KB_unit_pos = (Position of KB_Unit)
      • Set KB_point = (KB_Point_Old offset by (KB_Range / 15.00) towards ((Facing of KB_Unit) + 180.00) degrees)
      • Unit - Move KB_Unit instantly to KB_point
      • Special Effect - Create a special effect at KB_unit_pos using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set KB_Point_Old = KB_point
      • Set KB_RangeLeft = (KB_RangeLeft - (KB_Range / 15.00))
      • Destructible - Pick every destructible within 125.00 of KB_Point_Old and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
            • Then - Actions
              • Destructible - Kill (Picked destructible)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KB_RangeLeft Less than or equal to 0.00
        • Then - Actions
          • Unit - Unpause KB_Unit
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on Hard Parts <gen>
          • Set KB_Range = 0.00
          • Set KB_RangeLeft = 0.00
          • Set KB_Dmg = 0.00
          • Set KB_Unit = No unit
          • Custom script: call RemoveLocation(udg_KB_unit_pos)
          • Custom script: call RemoveLocation(udg_KB_point)
          • Custom script: call RemoveLocation(udg_KB_Point_Old)
        • Else - Actions
  • [B][I][U] Custom script: call RemoveLocation(udg_KB_unit_pos)
    • Custom script: call RemoveLocation(udg_KB_point)
    • Custom script: call RemoveLocation(udg_KB_Point_Old)[/U][/I][/B]
Notice now that the bolded destroy-point functions are at the bottom of the trigger and will fire no matter what the conditions are. This means that the point-location leaks will constantly be cleaned up in this trigger. Tomorrow I'll take a look at a few more of your triggers and see if i can come up with some more dirty socks.
 
Level 9
Joined
Jun 25, 2009
Messages
427
Could you do one favour for me? (i have a computer that i work this map on, but now it's gone for some days (it'll be back) so could you implement the things of the triggers & stuff? (and check if u can))

Tiche3 (ty :)):grin:
 
Last edited:
Status
Not open for further replies.
Top