Jump to content

ElementLoader yaml loader change breaks modded element loading


SGT_Imalas
  • Branch: Preview Branch Version: Windows Pending

In the new Aquatic Beta, the method ElementLoader.CollectElementsFromYAML was changed to using VYaml.

The list of yaml files that get iterated in that methods are derived from Klei.FileSystem, which virtualizes paths of mods to appear like sitting in the game directory. VYaml however uses System.IO.File.ReadAllBytes(path), which works fine for the games' own yaml files, but throws fatal parse error file not found:

[00:27:13.174] [1] [INFO] [RonivansLegacy_ChemicalProcessing]: Registering Substances
[00:27:19.254] [1] [WARNING] Fatal parse error in X:/SteamLibrary/steamapps/common/OxygenNotIncluded/OxygenNotIncluded_Data/StreamingAssets/elements/ChemicalProcessing_BioChem_Elements.yaml
Could not find file "X:\SteamLibrary\steamapps\common\OxygenNotIncluded\OxygenNotIncluded_Data\StreamingAssets\elements\ChemicalProcessing_BioChem_Elements.yaml"
[00:27:19.255] [1] [WARNING] Fatal parse error in X:/SteamLibrary/steamapps/common/OxygenNotIncluded/OxygenNotIncluded_Data/StreamingAssets/elements/ChemicalProcessing_IO_Elements.yaml
Could not find file "X:\SteamLibrary\steamapps\common\OxygenNotIncluded\OxygenNotIncluded_Data\StreamingAssets\elements\ChemicalProcessing_IO_Elements.yaml"

This in turn prevents the mod from being loaded as it gets disabled when not a dev-mod, also throws some mod events on the main menu:

image.png.5b52e1244209c0318e532ea0d8255b5f.png 

the path injected into the KYaml.LoadFile<ElementEntryCollection> method should not use the virtual filepath from FileSystem, but the true path when working with System.IO, it would be nice if this could be adjusted.


Steps to Reproduce

- have a simple mod in place and active that contains at least one custom element.yaml file under /modDir/elements/

- start the game

- ElementLoaders yaml loader will throw the fatal error of not finding the file in the game directory (and not the mod directory)




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...