Giter Site home page Giter Site logo

Comments (10)

Arnavion avatar Arnavion commented on June 21, 2024

Yeah, I don't have a Factorio install on Linux so I've only tested the web API there.

Can you check which one of the paths (if any) in https://github.com/mickael9/fac/blob/401fe28d/fac/files.py#L13-L40 matches your install?

from fac-rs.

remexre avatar remexre commented on June 21, 2024

None -- the case on SteamApps is wrong there too. I think it might be named SteamApps on Windows and steamapps on Linux, although I don't have a windows install near me to check.

It also looks like fac-rs doesn't search ~/.factorio, which contains the mods/mod-list.json and player-data.json files.

from fac-rs.

Arnavion avatar Arnavion commented on June 21, 2024

Right, so what's the full path of your Factorio install then?

from fac-rs.

remexre avatar remexre commented on June 21, 2024

/home/nathan/.local/share/Steam/steamapps/common/Factorio is the static files, /home/nathan/.factorio is the per-user data

from fac-rs.

remexre avatar remexre commented on June 21, 2024

I patched it to add ~/factorio and ~/.factorio to the search path and fix the capitalization, but now it dies because mod_list.json uses the string "true" instead of the boolean true for "enabled".

from fac-rs.

Arnavion avatar Arnavion commented on June 21, 2024

The true vs "true" is a change in 0.15 I believe. I changed it in ad35af38

from fac-rs.

remexre avatar remexre commented on June 21, 2024

I just deleted ~/.factorio, disabled Steam Cloud Sync, and started the game, and ~/.factorio/mods/mod-list.json was created with the contents:

{
    "mods": [
        {
            "name": "base",
            "enabled": "true"
        }
    ]
}

One solution would be to use #[serde(deserialize_with = "path")] to make a custom deserializer that accepts either a bool or a string, I guess.

from fac-rs.

remexre avatar remexre commented on June 21, 2024

It looks like cfg!(linux) isn't actually a thing -- cfg!(target_os = "linux") works, though.

from fac-rs.

Arnavion avatar Arnavion commented on June 21, 2024

deserialize_with may not be enough, since when it writes the file back it'll write the values as booleans even if they were originally strings. Just to confirm, you're on 0.14 right? Can you check if the game is able to load mod-list.json with boolean values instead of string values?

from fac-rs.

remexre avatar remexre commented on June 21, 2024

I'm on version 0.14.23, build 25374, and it's working as far as I can tell with plain bool. EDIT: The game does change it back to "true" on exit, though.

from fac-rs.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.