I'm trying to write data from my game to a txt file. Here's the example code:
var data = "my data"
var file = File.new()
This is essentially added to a button and activated when pressed, the button generates new data every time. Everything is working fine, I'm getting the data correct it's writing to file as well. The problem is whenever the button is pressed the current data overwrites the previous one.
I would like to keep all the data the button presses, but I can't figure out how to do that. I should mention that I'm using Godot to create a game for research purposes (PhD student) hence why I keep mentioning 'data' lol. The data is basically elements in the game state.