Closed TRSasasusu closed 1 year ago
If we don't use "dgarro.CustomShipLogModes"
, we don't get this error.
But, if we use "dgarro.CustomShipLogModes"
, we can get this error with below processes:
So, I add "dgarro.CustomShipLogModes"
into the conflict settings in https://github.com/TRSasasusu/TranslationForTheOutsider/commit/28f7413b0d023cb92b9e1ba1142c4424a1684d21
@TRSasasusu I wanted to figure out what was causing the incompatibility with my mod "dgarro.CustomShipLogModes"
to fix it, but I don't think it's something particularly related to that mod. There are some errors logged that come from it but that's just because the bug is preventing the custom modes mod from being initialized and so later operations that it tries to do fail.
I was able to reproduce this bug but just enabling Cheat And Debug Menu (in addition to The Outsider and Translation and Patches for The Outsider). The bug even reproduced without doing the bad ending:
I installed some random mods and the bug didn't happen (at least not with the steps I gave above), but with Dream World Modding and Debug Assist it happened again.
@dgarroDC hi, thanks for trying to figure out what causes the error.
The Outsider makes entries by itself in EVERY loading the game: OutsiderShipHandler.cs#L62-L77
So, I think, it would be broken if another mod adds the same entries which are added in the previous loading.
Does "dgarro.CustomShipLogModes"
have such a procesure?
No, it doesn't modify that object, and I don't think the other 2 mods do that too. So my guess is that The Outsider is the one adding the entries twice sometimes, maybe the comment there that says "resets when return to title for some reason though"
isn't always true?
hmmm... it's so weird.... I didn't encounter with the error without "dgarro.CustomShipLogModes"
yet.
So, I would consider this problem when someone encounters the error without "dgarro.CustomShipLogModes".
If you can reproduce the error without "dgarro.CustomShipLogModes", please tell me. Thanks.
Ah, did you say that only Cheat And Debug Menu
, The Outsider
and Translation and Patches for The Outsider
reproduced that error?
ok, I would consider the problem near days (now, i'm busy)
If you could reproduce the error with only The Outsider
and Translation and Patches for The Outsider
, please tell me. It would very helpful.
I reproduced with these combinations:
Custom Ship Log Modes
, The Outsider
and Translation and Patches for The Outsider
(although the steps of going to menu without triggering the bad ending didn't reproduce the bug I think)Cheat And Debug Menu
, The Outsider
and Translation and Patches for The Outsider
Dream World Modding and Debug Assist
, The Outsider
and Translation and Patches for The Outsider
But so far I didn't reproduce with The Outsider
and Translation and Patches for The Outsider
. I will tell you here if it happens.
Reading about scriptable objects, it seems they might be garbage collected on scene loads if they are not referenced. So when you go to the main menu, the ShipLogLibrary
would be freed from memory by the garbage collector, and it would be reloaded from disk (returning to its original state with only vanilla entries).
So maybe these other mods are (indirectly) holding references to the ShipLogLibrary
and prevents it from being collected, or maybe for some other reason, I don't know.
The Outsider shouldn't probably assume that the ShipLogLibrary
is reseted every time we go to the main menu and it should instead check if the entries are already there to avoid the duplicates, maybe a prefix patch for ShipLogLibrary.BuildEntryDataDictionary
to remove the duplicates would be needed.
These steps reproduce the error with Custom Ship Log Modes
:
This is different from Cheat And Debug Menu
and Dream World Modding and Debug Assist
. With those mods the bug reproduces even without opening the Ship Log before going to the menu, so it's easier to get the issue with those mods.
What I found is that in Custom Ship Log Modes
there is a field ShipLogMode _nextMode
that could reference the map or rumor mode, and those modes reference the ShipLogManager
, and this object references the ShipLogLibrary
. So, if _nextMode
is referencing one of the modes when the main menu scene is loaded, the ShipLogLibrary
won't be freed from memory by the garbage collector, so it won't be reset.
_nextMode
is only initialized when you open the ship log computer, so that's why that step is needed to reproduce the bug.
I actually tested adding _nextMode = null;
on scene load, and that fixed the bug (or at least it didn't reproduce with the steps above), but of course that isn't a real solution because other mods like Cheat And Debug Menu
and Dream World Modding and Debug Assist
could still trigger the issue.
Thanks. I think you are correct. So, I would fix it by avoiding the duplication with some prefix patches in next releases.
@dgarroDC Thank you, v1.1.6 has no conflicts with Custom Ship Log Modes
!
Sometimes, in some environments, the shiplog is bugged, only a title: PLANET NAME is appeared.
The error log is below:
ArgumentException: An item with the same key has already been added. Key: DB_NORTHERN_OBSERVATORY