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, "script@shows@cancan_dance@CanCanDanceP1", 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.

1 Like

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.

1 Like

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.

4 Likes

Iā€™m not going to play in these сhinese whispers. If you know someone who can help, ask if they could help yourself. RedM is an open source project, everyone can contribute. I removed your email address just because of security measures.

nvm, thatā€™s just a spamming bot.

1 Like