Jump to content

Resetting mod config data doesn't reset the value to the default option.


FelixTheJudge
  • Can't Reproduce

Resetting mod config data doesn't reset the value to the default option, instead erases the config data entirely. If the default is enabled, and you can switch to disabled. Hitting reset doesn't switch it back to enabled, it switches it to nothing. Causing neither the disabled nor enabled function of my code to work.

Here I added a picture of mod config options. Now, even though all the values are on enabled, code within modmain that requires them to be set to enabled don't work if I hit the reset button and start the server. Here's an example.

if EnableShops=="enabled" then    
    if IsServer then
inst:AddTag("shopper")
    end
    elseif EnableShops=="disabled" then
inst:RemoveTag("shopper")
end

If I click the arrows to disable, and back to enable, it works properly. However, hitting the reset button and then starting the server causes the code to not work, guessing the reset button isn't actually reading the default values of modinfo config options, and just erasing any data what so.

blips.png

 

 

To summarize. Hitting reset causes modconfig options to not work despite showing enabled.
Simply switching them to disabled, and then back to enabled causes them to work again.
This leaves be to believe reset button is erasing the options entirely, and not just reverting them to default.


Steps to Reproduce
Run any mod with config options that work on an on/off state. Reset the value to default, and start the server.



User Feedback


Changed Status to Can't Reproduce

@FelixTheJudge I wasn't able to reproduce this issue, can you post your modinfo.lua so I can take a look at your specific mod config setup. Also can you try clearing your Documents\Klei\DoNotStarveTogether\client_save\mod_config_data folder? I'm wondering if you have a weird state to your local client config.

Share this comment


Link to comment
Share on other sites

I have since changed my code and found a workaround by making the default option blank and the new config actually change something. I'm sorry. I tried to word the situation as best as possible but I'm not entirely sure if it was something I was doing wrong or just intentional behavior that has an adverse effect. Aka, behaving as it should, but not how I expected it to. Also, it behaved differently depending on if I was in a cave enabled server or not, which is why I changed how it was done in the first place. Sorry, I hope it wasn't too much of a bother.

Share this comment


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