Exception if Classic save is imported with modded location name

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Exception if Classic save is imported with modded location name

Post by XJDHDR »

A while ago, Pango reported an issue which he believed was caused by my mod, where a specific Classic save couldn't be imported if my mod was activated. The user had to disable the mod to successfully import it.

With the PR I just submitted, I found that the following exception is occurring when loading that save:

Code: Select all

An Exception occurred while attempting to load Classic save #0:
System.Exception: Error finding location Dragontail Mountains : The Crypts of Sish
  at DaggerfallWorkshop.PlayerGPS.DiscoverLocation (System.String regionName, System.String locationName) [0x00020] in E:\Repos\daggerfall-unity-my-fork\Assets\Scripts\Internal\PlayerGPS.cs:840 
  at DaggerfallConnect.Save.SaveGames.OpenSave (System.Int32 save, System.Boolean loadingInGame) [0x00223] in E:\Repos\daggerfall-unity-my-fork\Assets\Scripts\API\Save\SaveGames.cs:245 
  at DaggerfallConnect.Save.SaveGames.TryOpenSave (System.Int32 save) [0x00002] in E:\Repos\daggerfall-unity-my-fork\Assets\Scripts\API\Save\SaveGames.cs:278 
UnityEngine.Debug:LogError (object)
DaggerfallConnect.Save.SaveGames:TryOpenSave (int) (at Assets/Scripts/API/Save/SaveGames.cs:282)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:StartFromClassicSave () (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:504)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:InvokeStartMethod () (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:164)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:Update () (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:130)
This sounds like it is related to a bug fix I did where I corrected a typo in the names of a number of locations, including "The Crypts of Sish" (specifically, I corrected the incorrect capitalisation in the previous name: "THe Crypts of Sish"). From what I can tell, the game is probably getting a list of locations in the save that have been discovered, and marking them as discovered in the game's runtime data.

Is there a better way to handle this situation where a location's name in the save doesn't line up with what the game is using? For example, if the location's name doesn't match anything in the modded data, simply keep the location marked as undiscovered?

I have attached this archive with both the location override that caused this specific exception, and the save with this issue:
Exception triggering location and save.7z
(36.89 KiB) Downloaded 47 times

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Exception if Classic save is imported with modded location name

Post by BadLuckBurt »

Why not keep track of the name changes in a list that maps the old name to the new one or something like that. Then when importing a save, it can check against that list if it fails to resolve a classic location name.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

Post Reply