• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Producing text files for the viewer to read

L

Lily_WR

Guest
Hello, I'm working on a short experimental game using Game Maker Studio 2 on Windows!

My goal is to have it create and write additional text files that are visible and accessible to the player in the game's folder at certain points throughout the game, however I am not sure how to go about this and have been struggling to find discussion on the topic that doesn't revolve around a save/load system.


Currently I am using this code I found searching for a solution on here:

file = file_text_open_write(working_directory+"hello_world.txt");
file_text_write_string(file,"Hello world!");
file_text_close(file);

Would it be possible to redirect the target of the file's creation to the game folder(what a player would see immediately after opening the folder containing the game and its components)?
 
There are several extensions on the marketplace that allow you to read and write outside of the sandbox.

I wouldn't recommend writing to the game executable location usually, if your game used an installer to place the game in the Program Files folder, its probably protected via admin rights, but you can always test and see for yourself if you really want to go that route.
 
L

Ludo Design

Guest
As IndianaBones said, Game Maker is sandboxed. I'm including the link so that you can read up on it. Basically, explicit input or marketplace extensions are necessary to perform read/write file operations in the way you're suggesting. If you're considering an alternative destination, most games will write files to a created directory in a user's Documents folder.
 
L

Lily_WR

Guest
There are several extensions on the marketplace that allow you to read and write outside of the sandbox.

I wouldn't recommend writing to the game executable location usually, if your game used an installer to place the game in the Program Files folder, its probably protected via admin rights, but you can always test and see for yourself if you really want to go that route.
I see, thank you for your help!
 
Top