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

[Crash] Players always gets crash when picking a hero, except Player 1 slot

Status
Not open for further replies.
Level 7
Joined
Feb 22, 2009
Messages
158
Test it out yourself. Host map, pick hero (keep in mind, this is WIP project).

(Test it with 2+ players).

What happens is:

You are the only guy left in the game, other players crash instantly after picking their hero. I dont know where is the problem. Customscripts look fine, everything looks fine, I just don't know where the problem lies.

View attachment Nightmare Arena 0.01.w3x
 
Level 7
Joined
Feb 22, 2009
Messages
158
can u show the triggers plz.

Map isn't protected, it is very small. I would be glad if you checked them via WE.
There are loads of triggers already, but okay.

Here we go:

  • Hero Picked
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Tavern
    • Actions
      • Unit - Kill (Buying unit)
      • Set tempPoint = (Center of Heroes Sellected <gen>)
      • Unit - Move (Sold unit) instantly to tempPoint, facing Default building facing degrees
      • Set tempPoint = (Center of Heroes Sellected <gen>)
      • Camera - Pan camera as necessary for (Owner of (Buying unit)) to tempPoint over 0.01 seconds
      • Set SoldHeroes = (SoldHeroes + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SoldHeroes Equal to Players
        • Then - Actions
          • Trigger - Run END <gen> (ignoring conditions)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_tempPoint)
 
Level 7
Joined
Feb 22, 2009
Messages
158
i dont see anything that would cause desync. can u show me the trigger that is called ?

ur leaking the point when u store this the second time. it isnt necessary to store this a second time.
Set tempPoint = (Center of Heroes Sellected <gen>)

Thanks for the leakfix. I was very sleepy, when creating Initial v. of this map. :D So I stored it twice somehow.

  • END
    • Events
      • Time - PickHero expires
    • Conditions
    • Actions
      • Visibility - Destroy (Last created visibility modifier)
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start SpawnTime as a One-shot timer that will expire in 40.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Enemy Wave
      • Set tempGroup = (Units of type Soul Chooser)
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_tempGroup)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
 
Level 7
Joined
Feb 22, 2009
Messages
158
  • Visibility - Destroy (Last created visibility modifier)
This one is equal to null.
No modifier is made.

  • Set tempGroup = (Units of type Soul Chooser)
Unit of Type always leak according to Ralle's Things that Leaks, it's a black listed function.

Better?:
  • Hero Taverns
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set tempPoint = (Center of Create Teleporter <gen>)
      • Special Effect - Create a special effect at tempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Set tempForce = (All players controlled by a User player)
      • Player Group - Pick every player in tempForce and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Arena <gen>
              • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Tavern <gen>
              • Set tempPoint = (Center of Soul Chooser <gen>)
              • Camera - Pan camera for (Picked player) to (Center of Tavern <gen>) over 0.00 seconds
              • Unit - Create 1 Soul Chooser for (Picked player) at tempPoint facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Custom script: call DestroyForce(udg_tempForce)
  • END
    • Events
      • Time - PickHero expires
    • Conditions
    • Actions
      • Visibility - Destroy (Last created visibility modifier)
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start SpawnTime as a One-shot timer that will expire in 40.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Enemy Wave
      • Set tempGroup = (Units in Remove Soul Choosers <gen>)
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_tempGroup)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
Btw Destroy (Last creadet visibility modifier) works completely fine. I need that function. See?
 
Level 7
Joined
Feb 22, 2009
Messages
158
u can only bump a thread after 24 hrs plz be patient.

ur problem is the visibility modifier. when u destroy a null object it will cause a crash. also note that ur only destroying one of the visibility modifiers not the both of them

Dude, I tried to remove visibility modifiers, still same DESYNC. Not really a crash, they get desync. Tried it myself. Also, sorry for bumping, didn't knew you can't do that more than once after 24hrs.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Do not use Camera - Pan Camera As Necessary (Timed). Blizzard failed there and created a location inside a local block or modified GetCameraTargetPositionLoc to return a new object later on:

JASS:
function SmartCameraPanBJ takes player whichPlayer, location loc, real duration returns nothing
    local real dist
    if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.

        set dist = DistanceBetweenPoints(loc, GetCameraTargetPositionLoc())
        if (dist >= bj_SMARTPAN_TRESHOLD_SNAP) then
            // If the user is too far away, snap the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), 0)
        elseif (dist >= bj_SMARTPAN_TRESHOLD_PAN) then
            // If the user is moderately close, pan the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), duration)
        else
            // User is close enough, so don't touch the camera.
        endif
    endif
endfunction
 
Level 6
Joined
Jul 21, 2011
Messages
139
  • Set tempGroup = (Units of type Soul Chooser)
Unit of Type always leak according to Ralle's Things that Leaks, it's a black listed function.

is that true or not?

in ralle's things that leak it says "Unit Group - Pick all units of type Footman and do..."

setting units of type in a variable group sounds like something different
 
Status
Not open for further replies.
Top