Jump to content

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


Eggon
 Share

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

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

@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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...