DC 'cause of picking a hero.

Murre

New Member
Reaction score
14
Hey! I would like to get some help with my map.
The problem with it, is that whenever I host it on bnet with my friends, they get an auto-dc as soon as one of us pick a hero.
I will attach the map, and hopefully someone will help me. (I know it's basically just copied and pasted triggers from other tutorials etc. but I will credit the creators in the description. However, it's my way of learning :p)
Thanks!
/Murre :)


View attachment maptest1.w3x
 

Laiev

Hey Listen!!
Reaction score
188
Don't sure what cause your friends to DC... but have some (lot) of problem in your map...waits in global trigger (herorespawn), lots of leak and lots of triggers Oo'

Fixing leaks probably will reduce lag, and I think your friends get DC because this, or some other bug, but now my compute don't want me with editor opened -.-' sorry...

Is this what i can say, fix leaks and remove that wait
 

Murre

New Member
Reaction score
14
Then how do I make them spawn after 15 seconds? :eek: Won't they get instantly-spawned then?
Also, I don't know how to fix leaks.. nor what they are. So a link/explanation would be nice >_<
 

Laiev

Hey Listen!!
Reaction score
188
Hmm..
Will try to explain with easy method what leak is..

Leaks = mini-lags

You generates leak with point, forces (players group), unit group and special effects, but how to fix then? Easy..
Example:
Trigger:
  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees


to
Trigger:
  • Set - TempPoint = (Position of (Triggering unit))
    • Unit - Create 1 Footman for (Owner of (Triggering unit)) at TemPoint facing Default building facing degrees
    • Custom Script: call RemoveLocation (udg_TempPoint)


Explain... you need set in variable the point/special effect/player group/unit group, then use it and in the end remove/destroy it..
use custom script to do it

Here the list how to remove/destroy then:

call RemoveLocation (udg_XXX)
call DestroyGroup (udg_XXX)
call DestroyForce (udg_XXX)
And special effect have line in GUI to destroy it without custom script
Trigger:
  • Special Effect - Destroy (Last created special effect)


XXX = variable


correct me if i say something wrong
 

Murre

New Member
Reaction score
14
Dude, you are so awesome! THANKS! :)
Too bad I can't give you +rep tho. "/
I'll try it out and bump with the results tomorrow. :)
 

Murre

New Member
Reaction score
14
Hmm.. I'm fighting with it atm, but I tried to do like this:
Trigger:
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) for 45.00 seconds the text: Write -commands to ...
      • Set All_Players = (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Food cap to 1
          • Player - Set (Picked player) Current gold to 750
          • Player - Set (Picked player) Current lumber to 0
          • Camera - Pan camera for (Picked player) to (Center of HeroInvuln1 &lt;gen&gt;) over 0.01 seconds
      • Set Total_Heroes = 12
      • Set random_count = 12
      • Set hero_array[1] = Malicious Sorcerer
      • Set hero_array[2] = Demonic Beast
      • Set hero_array[3] = Plague Spreader
      • Set hero_array[4] = Stone Giant
      • Set hero_array[5] = Merciless Assasin
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set random_data[(Integer A)] = (Integer A)
      • Custom script: call DestroyGroup (udg_All_Players)


But when I was going to press "test map" the failure window or w/e it's called popped up. And it said "Invalid argument type"... so I don't rly know what I'm doing wrong. :p Please help? :)
 

Moridin

Snow Leopard
Reaction score
144
^ That's because all variables are case sensitive meaning:

AbcD is different from abcd which is different from AbCd etc.

Also, don't destroy All Players. It doesn't leak and destroying it will cause bugs in your map.
 

Laiev

Hey Listen!!
Reaction score
188
Hmm.. I'm fighting with it atm, but I tried to do like this:
Trigger:
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) for 45.00 seconds the text: Write -commands to ...
      • Set All_Players = (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Food cap to 1
          • Player - Set (Picked player) Current gold to 750
          • Player - Set (Picked player) Current lumber to 0
          • Camera - Pan camera for (Picked player) to (Center of HeroInvuln1 &lt;gen&gt;) over 0.01 seconds
      • Set Total_Heroes = 12
      • Set random_count = 12
      • Set hero_array[1] = Malicious Sorcerer
      • Set hero_array[2] = Demonic Beast
      • Set hero_array[3] = Plague Spreader
      • Set hero_array[4] = Stone Giant
      • Set hero_array[5] = Merciless Assasin
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set random_data[(Integer A)] = (Integer A)
      • Custom script: call DestroyGroup (udg_All_Players)


But when I was going to press "test map" the failure window or w/e it's called popped up. And it said "Invalid argument type"... so I don't rly know what I'm doing wrong. :p Please help? :)

Invalid argument type wheres? what line the editor show?

Also ... you set all_players = all players but you still use (All Players) in pick every player instead of variable

And you leak here:
Camera - Pan camera for (Picked player) to (Center of HeroInvuln1 <gen>) over 0.01 seconds

And... DestroyGroup = unit group, you need DestroyForce... BUT you know LeakCheck? (tool)
Can be found in TheHelper, search it :D you will learn alot about leaks, and i think you don't need to create player group variable, just pick every players and do action... I'm not sure if this is safe, other people <which know more about force leak then me> can say it :( sorry..
 

Murre

New Member
Reaction score
14
So I'm not supposed to set a variable there?
How do I know when to use variable - custom script, and when to not? :s'

Ahh, Laiev. Forgot to change that, thx ;) However.. how am I supposed to fix the camera leaks then?

Btw, the invalid arguments shew(?) the custom script as one. :p
 

Laiev

Hey Listen!!
Reaction score
188
I edited my post, see it again...

and the invalid argument is because you don't use that UNIT GROUP, you use PLAYER GROUP...

also...

here the copy/past how leak check fix this :D
(Line: 13) (Word: 8) Location Leak
Camera - Pan camera for (Picked player) to (Center of HeroInvuln1 <gen>) over 0.01 seconds
Camera - Pan camera for (Picked player) to ^Leak
(Suggested Fix) Set MyLocation = (Center of HeroInvuln1 <gen>)
(Suggested Fix) Camera - Pan camera for (Picked player) to MyLocation over 0.01 seconds
(Suggested Fix) Custom script: call RemoveLocation(udg_MyLocation)

Scan Complete
Location leaks: 1
Special Effect leaks: 0
Lightning leaks: 0
Unit Group leaks: 0
Player Group leaks: 0

Summary
Total Leaks: 1
Unremoved Variables: 0
Scan duration: 0 seconds
Total Lines Scanned: 24
Total Words Scanned: 143
Fixing Memory Leaks: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
 

avalya

New Member
Reaction score
37
Didn't read over all of this but you don't destroy a player group using 'call DestroyGroup (udg_All_Players)' <-- that is probably what's causing your problems, just pick every player in All Players (no variable, don't need it).
 

Murre

New Member
Reaction score
14
*BUMP*
I still have this problem. Whenever someone picks a hero (even other players than the host/player 1) everybody except for the host/Player 1 gets dcd... I find this very strange. "/ Even though I removed all of the leaks and removed the sound. :s
 

Rushhour

New Member
Reaction score
46
Show the trigger thats involved with picking a hero. This disconnect is a server split, a desyncronization between the different players. Most easily it can be done by creating a unit only at the "computer" of one player.
But for this you would need JASS (GetLocalPlayer() ), most function you get by GUI clicking are safe :D
The only one I know of has something to do with panning the camera. I'm not completly sure how it looks like, because it's only 1 that can cause problems.

(Does anyone know if you can show a leaderboard locally ? :p )
But it's not triggers only that can cause this, sometimes it's stuff in the object editor aswell.

Yeah, congratulations! You just picked the only GUI function that causes desyncs ;P

Trigger:
  • Camera - Pan camera as necessary for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.05 seconds

This one is evil, just pick any other pan camera function. This should solve your problem
Edit: I just went through your triggers.. you seem to love this function. It is everywhere. Just use a normal camera pan instead, the map isnt that big ;P

And you didn't remove "all" leaks, just look at the trigger with the 10 special effects. You need to destroy them. Most effects can be destroyed just after you created them and they still play the same animation. Add a Destroy(last created special effect) after every effect^^
 

Murre

New Member
Reaction score
14
Well if you check in the map, I use a lot of camera panning, but you say I should remove them? :s It's like "Pan camera for owner of sold unit" and stuff like that :O
 

Rushhour

New Member
Reaction score
46
Only the pan function that has the
"as necessary"
in it.
The others are perfectly fine. This one sets variables only for one player and this seems to lead to desyncronization.
The only difference between this panfunction and the others is that it checks if the distance between the target and current location is greater than a certain value (not sure how big).
Then it decides wheather to pan instantly or over the given time.

Do you really need this "as necessary"? I guess the locations are fixed?!
 

Murre

New Member
Reaction score
14
Uhm I don't know if I need it, but I'll change it and thanks, +rep for the help ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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