[Solved]File system not working

File system, specifically file creation, works when previewing, but won’t work once the project has been created and exported. (Built for Windows, in my case windows 10)
I used the:“Save a text into a file” action, with the following path:<FileSystem::UserdataPath()+FileSystem::PathDelimiter()+“My_Project”+FileSystem::PathDelimiter ()+“MyFile”+ToString(Variable(x))>
The folder “My_Project” is already created at that path.
The action works in the preview.
In the exported project it doesn’t.

Just to confirm, where do you think that path should be? There’s a chance you are in the wrong appdata subfolder.

I’ve used filesystem events as recently as Saturday on an exported build and worked fine.

The path should be right, it’s the same used in the preview.
<C:\Users\Username\AppData\Roaming\GDevelop\My_Folder>

That may be why you aren’t seeing it.

Preview is running out of GDevelop. So the folder path includes the GDevelop folder. When you have a compuled game this isn’t part of the path. So you need to check somewhere like

C:\Users\Username\AppData\Roaming\My_Folder

Ok I’ll try it tomorrow, although I also noticed that entire blocks of actions don’t get done when I export the project. But normally work when in preview.
I also tried using desktop path to save files earlier and that didn’t work either.

Update.
The path I was using was incorrect.
I figured out which path is the correct one once the project is exported, and created my folders there.

Plus, I had previous versions of the project still running on my pc, and I had also updated the gdevelop app while working on the project.
I am pretty sure that both these things were causing troubles, and all the new blocks I added after updating weren’t functioning.

So I closed everything, restarted the programs, and finally got it to work.
Always trust the good old reboot trick, I guess😂

Solved, thanks.

1 Like