Download

Extending Saved Move Data

Hello, since 4.26 with CMC, there is this part of the doc :

Extending Saved Move Data
Character Movement Component | Unreal Engine Documentation

And there is this part :

In your extended version of FCharacterNetworkMoveData , override the ClientFillNetworkMoveData function to copy or compute data from the saved move. Override the Serialize function to read and write your data using an FArchive ; this is the bit stream that RPCs require.

The issue is how override the ClientFillNetworkMoveData and access to our own FSavedMoveCharacter ?

virtual void ClientFillNetworkMoveData(const FSavedMove_Character& ClientMove, ENetworkMoveType MoveType) override;

Work fine, but the fact is FSavedMove_Character is obviously not our custom FSavedMove_Character, so we can’t get the custom data we want.

For example, here what i “try” to do :

void FCharacterNetworkMoveData_Anomalie::ClientFillNetworkMoveData(const
FSavedMove_Anomalie& ClientMove, ENetworkMoveType MoveType)
{
Super::ClientFillNetworkMoveData(ClientMove, MoveType);
bTest = ClientMove.bSavedTest;
}

Notice the FSavedMove_Anomalie instead of FSavedMove_Character.
FSavedMove_Anomalie is my custom extension of FSavedMove_Character, ofc this won’t gonna work as the function signature is not the same. How we can deal with this issue ?

Thanks !

Look at my plugin as that shows it off

I need to stop working to late, i solved it :

const auto CM = static_cast<const FSavedMove_Anomalie&>(ClientMove);

Was obvious.