Networking anim scenes

Env: Canary, Onesync, 1355, Artifact 4225

If loading a networked anim scene, the following will not work with onesync enabled.

local animscene = Citizen.InvokeNative(0x1FCA98E33C1437B3, "[email protected]@[email protected]", 2, "PB_MAIN", true, true)

_IsAnimSceneLoaded = function(animscene)
    return Citizen.InvokeNative(0x477122B8D05E7968, animscene, true, false)
    --return Citizen.InvokeNative(0x477122B8D05E7968, animscene, false, false)
end

print('LoadAnimScene(animscene)')
LoadAnimScene(animscene)
while not _IsAnimSceneLoaded(animscene) do Citizen.Wait(10) end
print('LOADED')

The above code works with onesync disabled and the anim scene is networked between clients. In order for it to load with onesync, we have to pass p1 and p2 as false, however the animations are teleported.

Scenario:
Player 1: See’s the can can dancers dancing around stage in st.denis.
Player 2: Sees the dancers but they are teleported around stage and not doing any movement.

Sadly this issue can’t be easily fixed. It’s behind well known head ache stuff called “array handlers”. Some attempts to research array handlers was done in FiveM, this might help. But still don’t expect it to be fixed anytime soon :frowning:

The reason why _IS_ANIM_SCENE_LOADED never return true when 2-nd arg is true is because 2-nd arg is basically “is all players prepared animscene” check which uses array handler.

A small update, I backported some array handlers code from FiveM and it seems it kinda works for simple array handlers like WORLD_DOORS. But animscenes code is a bit weird. There’s an array of array handlers and we have to research this, there wasn’t such “cases” in V.