Create directory action not working

I need help I am trying the create a directory for save files I am running windows 10 and I’m try to save a folder to the local disk (C:) folder because I know most people who download the game wont go in that folder and mess with things because it contains the windows folder I tried typing in Local disk directory different ways but it never worked here’s the ones I tried C:\ C:
This Pc\Local Disk (C:)
C: This Pc\Local Disk (C:)

Windows commonly doesn’t allow apps to create folders directly in the C: drive.

GDevelop also doesn’t allow it.

What you could do (and what 90% of games do), is create your folder in the User Profile’s Application Data (AppData) folder.

You will need to build out the expression to create the folder, since you can’t just do C:\users\etc.

More info is available here. Filesystem [GDevelop wiki]

the problem is is that how would gdevelop know what the users name is

Gdevelop would have to know the users name becuase in the directory C:\Users(Windows profile name)\AppData\Roaming

and i also tried it at first but didnt include my profile name in the code becuase not everyone profile name is going to be Ryan

GDevelop doesn’t need to know the User’s name.

Window does.

If you look at the page I posted, the User Profile directory expression automatically propogates the currently logged in user’s name.

Edit: The userdatapath expression, specifically.

i pasted FileSystem::UserdataPath() into it it didnt work

Then unfortunately you’re doing something else wrong.

You can read more about using the expressions here: File system [GDevelop wiki]

You might be using the wrong syntax, you are missing part of the syntax, or you have something blocking access to GDevelop.

For example, I just tested this and it works fine to create an “Example” folder in the user path.

so what exect folder does this take the file to?

sorry if i am getting a annoying i am just a kid and the way you speak with fancy words like syntax just confuses me @Silver-Streak

Because my user profile paths aren’t on the C drive, it takes them to
D:\Users\(myprofilenamehere)\AppData\Roaming\(YourGameNameFromProjectproperties)\Example

So for my above example, since the project was named “TestFolderCreate” it was
D:\Users\(myprofilenamehere)\AppData\Roaming\TestFolderCreate\Example

99% of Windows computers, it’ll create it at the same path as above, but on the C: drive.

Note: When you’re previewing, the data paths are The GDevelop 5 folder, so it’ll get created at:
C:\Users\(profilenamehere)\AppData\Roaming\GDevelop 5\Example
when you preview. After you compile your game it’ll create it at the normal location I mention above.

Gees this question was asked and answered a lot of time could anyone on all this community and with knowledge of GD make an example. if not would you like me to do it.

  • Please Ulises - Make an example for Directories
  • Bah!

0 voters

thx very much bro it finally worked turn out the reason it wasnt appearing is cuz i was in preview sry if i was annoying

1 Like