Eggon Posted July 27, 2022 Share Posted July 27, 2022 (edited) getSandboxOptions():loadCurrentGameBinFile() is looking for map_sand.bin file in Saves\Sandbox\ instead of the actual save folder, so it doesn't find it and error results. Edited July 27, 2022 by Eggon Link to comment Share on other sites More sharing options...
EnigmaGrey Posted July 27, 2022 Share Posted July 27, 2022 Seems to be working correctly. Though this looks like it's only used to load the options to provide free trait points when a character is created in an existing save. It doesn't return anything. What are you trying to do with it? Link to comment Share on other sites More sharing options...
Eggon Posted July 28, 2022 Author Share Posted July 28, 2022 @EnigmaGreyI noticed that modified Sandbox settings are not accessible in the early stages of mod files loading (the actual loading of files, prior to events like onGameBoot) - the SandboxVars.myModName will contain default settings, not current ones(!). The current ones are loaded at some later point, but this is too late for conditionally tweaking item/vehicle scripts. As a solution I found this method getSandboxOptions():loadCurrentGameBinFile() in PZ lua scripts. It did refresh the SandboxVars even for the early stages of loading. However people using version 41.73 complained that this line throws the error I mentioned above. It worked for me in 41.71. That's why I submitted this bug report. I do see though there's also a load() method on the SandboxOptions. Is it better suited for the purpose? It seems to be refreshing the values too. At least in 41.71. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted July 30, 2022 Share Posted July 30, 2022 The function does depend on a sandbox game being in progress to work, as it's loading the sandbox bin directly from the save. So it's possible the error people are getting are either because they're not playing a sandbox game or have never played a sandbox game in the first place. It'd probably be best to find an alternative way to query/modify the settings. Link to comment Share on other sites More sharing options...
Eggon Posted July 31, 2022 Author Share Posted July 31, 2022 @EnigmaGreyI'm not sure if that is indeed what happened as he provided the log of the error and it says: Quote C:\Users\username\Zomboid\Saves\Sandbox\map_sand.bin (The system cannot find the file specified) It clearly points to incorrect folder. He also said he did have the file , but in the actual saves folder. What other way would you suggest? I switched to getSandboxOptions():load() Should it behave better? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now