Raicuparta / unity-vr-patcher

Force VR mode in Unity games
MIT License
28 stars 7 forks source link

System.IO.DirectoryNotFoundException / Object Reference not set to an instance of an object #2

Open syberphunk opened 2 years ago

syberphunk commented 2 years ago

Attempted to patch The Stanley Parable Ultra Deluxe, which is now in Unity

Backing up 'E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\patcher\The Stanley Parable Ultra Deluxe_Data/globalgamemanagers'...

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\patcher\The Stanley Parable Ultra Deluxe_Data/globalgamemanagers'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost) at System.IO.File.Copy(String sourceFileName, String destFileName) at UnityVRPatcher.Program.CreateGameManagersBackup(String gameManagersPath) at UnityVRPatcher.Program.Main(String[] args) Press any key to close this console.

The game does not have a 'globalgamemanagers' folder.


Discovered this was because I was not doing it in the game's folder, did so and found a different error:

E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe Backing up 'E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\The Stanley Parable Ultra Deluxe_Data/globalgamemanagers'... Backup already exists. Copying plugins... Found plugins: E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\Plugins\openvr_api.dll, E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\Plugins\OVRPlugin.dll Patching globalgamemanagers... Using classData file from path 'E:\SteamLibrary\steamapps\common\The Stanley Parable Ultra Deluxe\classdata.tpk'

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at AssetsTools.NET.Extra.AssetHelper.FindAssetClassByID(ClassDatabaseFile cldb, UInt32 id) at AssetsTools.NET.Extra.AssetsManager.GetATI(AssetsFile file, AssetFileInfoEx info, Boolean forceFromCldb) at UnityVRPatcher.Program.PatchVR(String gameManagersBackupPath, String gameManagersPath, String classDataPath) at UnityVRPatcher.Program.Main(String[] args) Press any key to close this console.

Raicuparta commented 2 years ago

I'm actually already working on a Stanley Parable VR mod, but yeah, this patcher isn't working for it. I got it working with just using UABE, will look into auto patching later. I didn't really try to improve this patcher to make it work in all possible project variations, so it makes sense that it can still fail often. Not sure if I'll ever update this again.

In any case, if you wait a bit a first version of the mod should be available soon.

By the way, globalgamemanagers is a file, not a folder. Just doesn't have an extension.