Korolen
New User (Why do I keep getting those red bars?)
- Reaction score
- 69
I finally got map map to "beta stage", and have started to host it on Battle.net... and have experienced many hurtles of the players getting disconnected from desyncs.
I need some help on a few aspects as to what is causing the desyncs and what I can do to fix them.
At first, everyone got disconnected the instant the game started... I fixed this one by changing
to
Next, people got disconnected whenever this "floating error" script was run:
I fixed it by initializing "tag" to null.
Now, for the unsolved "hurdle". I added a tutorial to the beginning of the map... however, when a player skips it, it disconnects them. I found that the Blizzard cinematic code set the gamespeed, so I copied the "local" code except fo r that from the BJ function into the end_cinematic function, but the players still get disconnected. I'm guessing that there is a problem with fade filters, but I'm not sure. Here is all the relevant code.
The tutorial trigger:
The "skip" code:
And the "end_cinematic" function:
Now I'm also wondering, if the fade filters are the problem, why Elil's local cinematic be so complex if you could do this... Only the latter looks just like the normal function but with the GetLocalPlayer()==target player comparison in the function instead of outside it. I don't get why the latter would work at all, and if it does, why would it work any better then moving the GetLocalPlayer() comparison outside the function? I'd really like to know exactly what is safe and what is not... I've done a bit of research and have found different opinions.
EDIT: I have also experienced random desyncing when playing my map on bnet; I'll post relevant code as I narrow down what is causing it.
I need some help on a few aspects as to what is causing the desyncs and what I can do to fix them.
At first, everyone got disconnected the instant the game started... I fixed this one by changing
Code:
Custom script: if GetLocalPlayer() != GetOwningPlayer(GetEnumUnit()) then
Unit - Hide (Picked unit)
Custom script: endif
Code:
Custom script: if GetLocalPlayer() != GetOwningPlayer(GetEnumUnit()) then
Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
Animation - Change (Picked unit)'s size to (0.00%, 0.00%, 0.00%) of its original size
Custom script: endif
Next, people got disconnected whenever this "floating error" script was run:
Code:
function create_floating_error takes player p, string text, location l returns texttag
local texttag tag
if GetLocalPlayer() == p then
set tag = CreateTextTag()
call SetTextTagPos(tag, GetLocationX(l), GetLocationY(l), 30)
call SetTextTagTextBJ(tag, text, 8)
call SetTextTagPermanent(tag, false)
call SetTextTagFadepoint(tag, 0.5)
call SetTextTagLifespan(tag, 1.3)
endif
return tag
endfunction
Now, for the unsolved "hurdle". I added a tutorial to the beginning of the map... however, when a player skips it, it disconnects them. I found that the Blizzard cinematic code set the gamespeed, so I copied the "local" code except fo r that from the BJ function into the end_cinematic function, but the players still get disconnected. I'm guessing that there is a problem with fade filters, but I'm not sure. Here is all the relevant code.
The tutorial trigger:
Code:
Tutorial
Events
Conditions
Actions
Custom script: local string s
Cinematic - Turn cinematic mode On for (All players)
Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Set Playing_Cinematic[((Player number of (Picked player)) - 1)] = True
Custom script: call cinematic_message(7, "Welcome to Beast Bloodshed. This is a quick tutorial to introduce you to the game. If you have already played Beast Bloodshed and would like to load your code, press [\\[^ESC^\\]]|r at any time.")
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Environment - Set fog to style Linear, z-start 1000000.00, z-end 10000000.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
Player Group - Pick every player in Players and do (Camera - Apply Main Area <gen> for (Picked player) over 0.00 seconds)
Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Custom script: call cinematic_message(8.5, "The goal of the Beast Bloodshed is to breed the prefect champion to conquer the other players in competitions.|n|nThis is the main area. Everyone's beasts that are not currently competing are located here.")
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to ((Picked player) start location) over 1.00 seconds
Camera - Set (Picked player)'s camera Angle of attack to -35.00 over 1.00 seconds
Camera - Set (Picked player)'s camera Rotation to (Angle from ((Picked player) start location) to (Center of Main Area <gen>)) over 1.00 seconds
Camera - Set (Picked player)'s camera Distance to target to 1800.00 over 1.00 seconds
Custom script: call cinematic_message(6.5, "This is your main base. Purchase new beasts here. New beasts will not appear until the start of the next Main Phase, or directly after the competition.")
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Custom script: set s = "These are the crafters and the Bet Collector. The Potion Brewer can concoct powerful potions that will help your beasts outside of battle, and the Armor Crafter can forge sturdy armor to protect your beasts in battle. "
Custom script: set s = s + "The Bet Collector will allow you to enter your beasts into the competition and to place bets on who will win."
Custom script: call cinematic_message(-1, s)
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Shops <gen>) over 1.00 seconds
Wait 1.00 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Rotate camera (360.00 - (Angle from ((Picked player) start location) to (Center of Shops <gen>))) degrees around (Center of Shops <gen>) for (Picked player) over 9.00 seconds
Custom script: call cinematic_message(-1, s)
Wait 9.00 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Custom script: set s = "Comptetitions such as racing, sumos, deathmatches, and endurance games will happen periodically."
Custom script: call cinematic_message(-1, s)
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Long Race Start <gen>) over 1.50 seconds
Camera - Set (Picked player)'s camera Rotation to 0.00 over 1.50 seconds
Camera - Set (Picked player)'s camera Distance to target to 500.00 over 1.50 seconds
Wait 1.50 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Long Race Finish <gen>) over 1.00 seconds
Wait 0.80 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Figure Eight <gen>) over 1.80 seconds
Camera - Set (Picked player)'s camera Distance to target to 3500.00 over 1.80 seconds
Camera - Set (Picked player)'s camera Angle of attack to 304.00 over 1.80 seconds
Wait 1.80 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Arena <gen>) over 0.50 seconds
Wait 0.50 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Rotate camera 90.00 degrees around (Center of Arena <gen>) for (Picked player) over 1.50 seconds
Wait 1.50 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Sumo <gen>) over 0.50 seconds
Wait 0.50 seconds
Custom script: if udg_Playing_Cinematic[GetPlayerId(GetLocalPlayer())] == false then
Skip remaining actions
Custom script: endif
Player Group - Pick every player in Players and do (Actions)
Loop - Actions
Camera - Set (Picked player)'s camera Distance to target to 0.00 over 1.00 seconds
Cinematic - Fade out over 0.80 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Wait 1.20 seconds
Custom script: call end_cinematic(GetLocalPlayer())
Code:
Skip Cinematic
Events
Player - Player 1 (Red) skips a cinematic sequence
Player - Player 2 (Blue) skips a cinematic sequence
Player - Player 3 (Teal) skips a cinematic sequence
Player - Player 4 (Purple) skips a cinematic sequence
Player - Player 5 (Yellow) skips a cinematic sequence
Player - Player 6 (Orange) skips a cinematic sequence
Player - Player 7 (Green) skips a cinematic sequence
Player - Player 8 (Pink) skips a cinematic sequence
Conditions
Playing_Cinematic[((Player number of (Triggering player)) - 1)] Equal to True
Actions
Custom script: call end_cinematic(GetTriggerPlayer())
Code:
function end_cinematic takes player p returns nothing
set udg_Playing_Cinematic[GetPlayerId(p)] = false
if GetLocalPlayer() == p then
call ResetTerrainFog()
call ResetToGameCamera(0)
call PanCameraToTimed(GetPlayerStartLocationX(p), GetPlayerStartLocationY(p), 0)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 0.40, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0)
call ShowInterface(true, .4)
call EnableUserControl(true)
call EnableOcclusion(true)
call VolumeGroupReset()
call EndThematicMusic()
call CameraResetSmoothingFactorBJ()
endif
endfunction
Now I'm also wondering, if the fade filters are the problem, why Elil's local cinematic be so complex if you could do this... Only the latter looks just like the normal function but with the GetLocalPlayer()==target player comparison in the function instead of outside it. I don't get why the latter would work at all, and if it does, why would it work any better then moving the GetLocalPlayer() comparison outside the function? I'd really like to know exactly what is safe and what is not... I've done a bit of research and have found different opinions.
EDIT: I have also experienced random desyncing when playing my map on bnet; I'll post relevant code as I narrow down what is causing it.