• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Crash] Game desync. Host's game crashes on camera trigger

Status
Not open for further replies.
Level 2
Joined
Jun 20, 2021
Messages
5
Hi there!

I'm fairly new to map editing and just started to incorporate some JASS into my new map.
The map works fine when testing it from the editor, however when testing it with other players over custom games
the map seems to desync and I get returned to the main menu upon a certain trigger activating,
which simply changes the camera view for players.

I've added the map, so you can have a look at it. The trigger that seems to cause the problem is "Main Camera"
located in the category Game Basics/Commands.

Hope someone can help with that problem, cause I'm pretty clueless as to what causes it.
Let me know, if I can provide additional information, that might help.
 

Attachments

Good that you ask! No I'm not using "pan camera as needed" (as far as i know). Here is the trigger that is probably causing the crash. At least the game always crashes when any player in a custom game activates it.

JASS:
function Trig_Main_Camera_Actions takes nothing returns nothing
    call ResetToGameCameraForPlayer( GetTriggerPlayer(), 0 )
        call SetCameraFieldForPlayer( GetTriggerPlayer(), CAMERA_FIELD_TARGET_DISTANCE, 4000.00, 0 )
        call SetCameraBoundsToRectForPlayerBJ( GetTriggerPlayer(), udg_activeRoomRegion[0] )
        call SetCameraTargetControllerNoZForPlayer( GetTriggerPlayer(), udg_activeRoom, 0, 0, false )
       set udg_tempGroup = GetUnitsInRectOfPlayer(udg_activeRoomRegion[0], GetTriggerPlayer())
        call SelectGroupForPlayerBJ( udg_tempGroup, GetTriggerPlayer() )
        call DestroyGroup(udg_tempGroup)
endfunction

//===========================================================================
function InitTrig_Main_Camera takes nothing returns nothing
    set gg_trg_Main_Camera = CreateTrigger(  )
    call DisableTrigger( gg_trg_Main_Camera )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(1), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(2), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(3), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(4), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(5), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(6), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerRegisterPlayerKeyEventBJ( gg_trg_Main_Camera, Player(7), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
    call TriggerAddAction( gg_trg_Main_Camera, function Trig_Main_Camera_Actions )
endfunction
 
Okay I've done some testing and it seems to be the selection part of the trigger that causes the desync so this part:
JASS:
       set udg_tempGroup = GetUnitsInRectOfPlayer(udg_activeRoomRegion[0], GetTriggerPlayer())
        call SelectGroupForPlayerBJ( udg_tempGroup, GetTriggerPlayer() )
        call DestroyGroup(udg_tempGroup)
Does anyone know, why that may cause a desync and how to get around it?
 
Status
Not open for further replies.
Back
Top