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

  • Depth Crawl.w3m
    144.3 KB · Views: 8
Level 2
Joined
Jun 20, 2021
Messages
5
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
 
Level 2
Joined
Jun 20, 2021
Messages
5
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.
Top