CoolGiraffe1
Member
(v2.3.3.437 Windows non-steam version)
Hi,
I'm trying to export a json string into a .json file, but nothing is happening and no file is written to my "working_directory" folder.
Apparently none of the file writing functions seems to be working for me.
Heres what i've tried so far:
Maybe i'm missing something obvious. Appreciate any insight or help in that matter.
Cheers.
Hi,
I'm trying to export a json string into a .json file, but nothing is happening and no file is written to my "working_directory" folder.
Apparently none of the file writing functions seems to be working for me.
Heres what i've tried so far:
- Checked if the json var isn't empty using the debugger.
- I checked the "working_directory" folder that is created in %localappdata%.
- Tried compiling the game exe to see if that helps.
- I also tried writing a simple string "hello" to a .ini file.
- Made an empty file with the name "tiledata.json" and writing to it but nothing is happening.
- I used both the YYC compiler and the VM one.
GML:
var map = ds_map_create();
ds_map_add(map, "tile", tileInfo);
var json = json_encode(map);
var theJsonFile = file_text_open_write("tiledata.json");
file_text_write_string(theJsonFile, json);
file_text_close(theJsonFile);
ds_map_destroy(map);
Cheers.