Path of save/load scene variable

hi,

when i use something like this: image

it saves file in the main directory of GDevelop.

how i can change this path, to save in the main folder of my game? the file can be included in the final project exe?

thanks,

Ermes

I recommend reading about the Filesystem events in general, including the expression discussion at the bottom: File system [GDevelop wiki]

You will need to build out your path using expressions + the file name yo uwant to save.

1 Like

but still not working. saving somewhere over the rainbow.

i know is my fault but i don’t understand.

edit. it saves in i: with the name GdevelopG1.save…

My guess is the issue is you’re using the ExecuteablePath, which is the path to your .exe. Which will be invalid with how you’re trying to use it. You probably want to do the ExecetuableFolderPath, however what I’d recommend you do is the same thing that all other games do, and use the user data path.

In Windows, this ends up as your Appdata folder (Found via going to Start > Run > %APPDATA% > Ok)

So you should do something like FileSystem::UserdataPath() + FileSystem::PathDelimiter() + “MyGameNameWithoutSpaces” + FileSystem::PathDelimiter() + “G1.save”

That will store it at %appdata%\Roaming\MyGameNameWithoutSpaces\G1.save on your final export.

Note: When testing saves in preview, it’s treating the GDevelop folder as your app data folder, so the saves will be stored there.

1 Like

ah now i see the truth. thanks for your time.

well, my idea is to use a precompilate field of data for mapping purpose, so i can’t use the user data folder.

Ermes

I’m not 100% sure that’s going to do what you think it will do, but you’re welcome to try. Ensure you use the ExecutableFolderPath and not ExecuteablePath expression, though.

1 Like