Text Files

Text files are a useful way to store large amounts of data externally from your game. Contrary to ini files, you can have up to 32 text files open at once, and you can read and write large chunks of data to them as well. However, it is up to you to decide how that data should be structured as there is no set "section" or "key" structure like with *.ini files.

Please note that for games with localizations it is very important that accented letters can be read from external files. This means that you should create the txt file in UTF8 format first and then add it into GameMaker Studio 2 as an included file so that it is exported on running the game and used instead of the default ANSI format txt file that is created by the GameMaker Studio 2 file functions when no file is previously supplied. In this way, you can read and write to it correctly with all accents and non-roman letters being maintained.

The following functions exist that deal with files:

WARNING! This function may not work as you expect due to GameMaker Studio 2 being sandboxed! Please see the section on File System Limits for more information.