Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
11 stars 6 forks source link

[Bug] Saved mod data won't persist if mod folder contains special characters #562

Open FlorentP42 opened 1 month ago

FlorentP42 commented 1 month ago

Describe the bug

I named one of my mods folders "something!" and discovered that the saved data in the registry for that mod won't persist when you close and reopen the game. Not sure if the special character being at the end matters or not but removing that character fixes it.

Steps to reproduce the behavior

  1. Create a mod folder named "test!"
  2. Create a main.lua script in this mod folder with the following code:

    
    function tick()
    
    local path = 'savegame.mod.value'
    local value = GetInt(path)
    if InputPressed('e') then
        value = value + 1
    end
    SetInt(path, value)
    
    DebugWatch("value", value)

end


3. Start a map with this mod enabled and press E a few times.
4. Quit and then reopen the game.
5. Start a map with this mod enabled.
6. Notice that the starting value was reset (ie: not saved).

### Expected behavior

Registry values in the mod savegame location are saved no matter the name of the directory the mod is in.

### Environment

- Teardown Version: 1.5.4
- OS: Windows
- GPU: NVIDIA GeForce RTX 3070 Ti
- Graphics driver version: 552.22
- CPU: AMD Ryzen 7 6800H with Radeon Graphics

### Additional context

_No response_
nooitaf commented 1 month ago

I assume this is only relevant for local mods.. as published mods use the workshop id. It's also not "the name" of your mod, it's just the folder. The actual name of your mod is set in info.txt. Afaik, uncommon characters in mod names get replaced on "Make local copy".

FlorentP42 commented 1 month ago

@nooitaf: I updated the description to clarify that I was indeed talking about the folder name not the actual mod name from info.txt And the issue was happening for me on a local mod before publishing it, so idk if it would happen for subscribers too as I fixed it before actually publishing the mod.

Gregory-Gregory commented 1 month ago

@FlorentP42 hey!

Thank you for reporting this issue. It has been forwarded to the QA team for additional investigation.