So I have a working directory for MacOS installation folder but now I need to work out how to use the Windows directories. Is there any way to access the program files of windows devices, as I need to access steam through there.

  • Toxe replied to this.

    The registry has SteamPath in HKEY_CURRENT_USER\Software\Valve\Steam. Note that the macos path isn't guaranteed here - I have a system where the app is in /opt.

    What's your objective?

      Cakestax To get the default directory on C: you can use %ProgramFiles(x86)%\Steam\steamapps\common as your prefix.

      But why do you need that? Keep in mind that people often have more than one location where they install their games. For example I have a Steam apps folder on drive C: and E:.

      If you really need to know where someone installed a game you should ask them and let them pick a directory. Although of course it cannot hurt to check some default locations and try to find it yourself first but in the end you should ask.

        Toxe Well I just need to access one file in the steam directory which should be in the games installation folder. I will most likely add some setting where you can change the directory for your steam.

        • Toxe replied to this.

          spaceyjase I just need the steam folder so I can access a file called "userdata" used to store .json files for saves.

          Toxe Yeah I'm already using GDextension by gramps but the steam file system doesn't work so I just use godets file access + The steamclouds auto synchronisation

          Toxe Is there any way to just get the installation folder of my steam game for saving and loading data

            Cakestax Probably via the Steam API but I have never used it before.

            Cakestax What exactly are you trying to do anyways? Do you want to access the Steam directory of another game?

            Or are you trying to access your own directory? In that case you just need to access the "res://" directory.

              Toxe Ok after some digging I found out how to get the correct directory regardless of where somebody stores steam on their device. But I have one last problem:

              When printing the applications file path (Which should be the games steam installation folder)

              On windows it works great, however because of how Mac works, I get this result:

              Now the bit I highlighted in red is the part that I DONT want. I just want to get to common/Plethora as this is the installation folder. (I also don't need plethora.app)

              So to work backwards I tried to add on ../MacOS../Contents../Plethora.app../Plethora/userdata/ to the end but this didn't work.

              To sum up, I just need to get to the common/Plethora folder somehow through this directory. Maybe some way to get the parenting files and work my way to the installation folder as I have everything here that I need.

              • Toxe replied to this.

                Cakestax If you are on macOS simply cut off the last part of the string.

                I'm still not sure what you're trying to achieve - if you're in the game's base/install directory, aren't you then also in godot's file system res:// and user://? I don't follow why you need to know about anything outside of the game's folder structure; the game should be agnostic to Steam's location.

                edit: if you’re looking to Steam to cloud save, that’s configurable in Steamworks and you should save to a known path, like those provided by godot (which go into the user’s data folders); you’d then select this path in the app’s Steam page. It’s not something you need to ‘code’.