While using RolePlayerAsset.SaveToFile(string path) where path is both a relative path and a different path from the original RPC file, the references to the components of the RPC (EDM, EA, etc) are saved with wrong relative paths.
A quickfix would be to use absolute paths (using the System.IO.Path.GetFullPath method) for every LoadFromFile and SaveToFile methods as such:
IntegratedAuthoringToolAsset IAT = IntegratedAuthoringToolAsset.LoadFromFile(Path.GetFullPath("Example Folder\\Example-IAT.iat"));
RolePlayCharacterAsset RPC = RolePlayCharacterAsset.LoadFromFile(Path.GetFullPath("Example Folder\\ExampleRPC.rpc"));
RPC.SaveToFile(Path.GetFullPath("Example Final Folder\\ExampleFinalRPC.rpc"));
This will put the correct relative paths into the final RPC file.
Please do note that System.IO.Path.GetFullPath returns a full path relative to the current working directory.
While using
RolePlayerAsset.SaveToFile(string path)where path is both a relative path and a different path from the original RPC file, the references to the components of the RPC (EDM, EA, etc) are saved with wrong relative paths.A quickfix would be to use absolute paths (using the
System.IO.Path.GetFullPathmethod) for everyLoadFromFileandSaveToFilemethods as such:This will put the correct relative paths into the final RPC file.
Please do note that
System.IO.Path.GetFullPathreturns a full path relative to the current working directory.