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

[Trigger] Room split on map init

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
I've been having a strange issue with my map and haven't been able to fix it

Players playing my map would disconnect when the game starts but the strange thing is, it only happens if it isn't your first game in multiplayer since you joined the battle.net (I've tested it with my friends many times). Due to this problem.. there would be only a few players left when I start the game with like 12 players

Anyone know a solution to this problem (or what the problem may be)?
I'm pretty sure I've used GetLocalPlayer() correctly, I didn't use the bad BJs like smart pan camera.

quest? texttags? i also have a system using GetLocalPlayer on creating texttags since I've heard that it uses a global array and does not cause desync (it's not used in map initialization anyway)
I'm also creating a lot of units / hastable saving in init, so I split the actions up by using a timer
 
ALIENS! It's a sign! I knew it! I knew it! I-

i also have a system using GetLocalPlayer on creating texttags

Oh... :c
type texttag extends agent

Thus texttags will cause desyncs if created in GetLocalPlayer().
You can however hide the texttags like this:

call SetTextTagVisibility(texttag, GetLocalPlayer() == p)

This shows it for p only.
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
Creating texttags locally is the way to go, mostly because of the hardcoded limit : 100 texttags at a time.
Now, it would be safer to define the string outside the local block, to avoid any possible desync with the internal string table.
Even if i think it does not matter, especially because the typecast string <-> integer string pointer is not allowed anymore, and anyway if it would desycn, local strings (depends wc3 languages) wouldn't work ...

Upload your map, or just the map script.
 
Level 6
Joined
Oct 23, 2011
Messages
182
Thanks for comments, here is my Init (other than spell struct initializers using SpellEffectEvent from Bribe)

I've tested to see if it was because of widgetized maps or not by making random maps with triggers; I found out that playing my map after playing any other map causes desync (host never gets disconnected though)

JASS:
           local integer   i   = 16
            local player    p   = Player(PLAYER_NEUTRAL_PASSIVE)
            local trigger   trg = CreateTrigger()
            
            set udg_Field = GetWorldBounds()
            
            call TriggerAddCondition(trg, Condition(function OnLeave))
            call TimerStart(NewTimer(), .1, false, function LoadStuff)
            
            loop
                set i = i - 1
                
                set P[i] = Player(i)
                call DisplayTimedTextToPlayer(P[i],0,0,5,"Please select a character.")
                
                exitwhen (i == 0)
            endloop
            
            set i = 8
            
            loop
                set i = i - 1
                
                if (GetPlayerSlotState(P[i]) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(P[i]) == MAP_CONTROL_USER) then
                    set Playing[i] = true
                    call TriggerRegisterPlayerEvent(trg, P[i], EVENT_PLAYER_LEAVE)
                endif
                
                exitwhen (i == 0)
            endloop
            
            set UnitIndexer.enabled = false
            call CreateUnit() // 8 times
            set UnitIndexer.enabled = true
            set p = null
            
            call XE_PreloadAbility() // About 80 times.
 
Last edited:
Status
Not open for further replies.
Top