How to manipulate .tres files from a HTML5 export

Godot Version



Hello, I’m trying to make a management game for a school project that requires the game to be exported to the web.
In my game, I’m using resources as .tres files to store the gameState of my game.
Since I began to test the exporting part, my browser is giving me an error message

index.js:14142 USER ERROR: Cannot save file ‘res://Data/GameStateData.tres’.

Which I believe is normal since the file structure of the game is completely different as a web app. Do you have any informations about what can I do to maintain persistence throughout the game as a webapp ? Maybe cookies ? Or maybe just create a specific file on the node.js server that will be written and read ? Do I have to rethink the logic to use other format than .tres ?

Thank you

res:// is read-only in certain platforms. Use user:// to be able to write files. More info here File system — Godot Engine (stable) documentation in English