Jump to content

getSandboxOptions():loadCurrentGameBinFile() throws an error in 41.73


Eggon

Recommended Posts

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 by Eggon
Link to comment
Share on other sites

@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

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

@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

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...