Author Topic: Making a Spoilerless Readme (GMS)  (Read 1426 times)

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 47.0.2526.106 Chrome 47.0.2526.106
    • View Profile
  • Playstyle: Keyboard
Making a Spoilerless Readme (GMS)
« on: January 09, 2016, 10:24:34 AM »
So you want to make a game. You want to properly document the resources that you're using in the game because you're not an asshole, but you also don't want to reveal something about the game. Secret final boss? Elaborate plot twist? Some things should only be known after the game is beaten and making credits is pain! Here's a solution for you.

First, you need the GMFileSystem extension. You can get that at https://gmc.yoyogames.com/index.php?showtopic=567528. Unfortunately, this is necessary because of the way Game Maker Studio is constructed. With the base program you can't easily interact with files outside of their %appdata% home, which is generally unhelpful given the traditional packaging of fangames. This extension supports interaction with files in other locations.

Second, create a new script. Call it whatever, it doesn't particularly matter. Try WriteReadme or something. Put the following into it:
var file;
file = FS_file_text_open_write(working_directory + 'Readme.txt');
FS_file_text_write_string(file, "Designed by whoever

Song List:
Sick beats

External Resources:
amazing sprites.");
FS_file_text_close(file);

This will create a text file (in this case called Readme.txt) in the folder containing the executable, which will have this text in it:
Designed by whoever

Song List:
Sick beats

External Resources:
amazing sprites.

Now just execute that script whenever you want the readme to be added to the folder. I know what you're saying already though. "But Kyir, I just want to add resources stage by stage whenever they appear!" Nothing simpler!

Once you've created the readme, either by this method or with a traditional one, you just need to substitute in
file = FS_file_text_open_append(working_directory + 'Readme.txt') 

and whatever text you add with it should appear at the end of whatever is in the file already. In this case, you'll probably want to create a system that will allow a lot of slight modifications, such as making the string in the script a variable and creating an object whose creation code sets the string and executes the script on collision, but I trust you all to figure out stuff like that!

There are other finer tweaks you can do too if you use the commands found in the extension's documentation: https://dl.dropboxusercontent.com/u/61559928/filesystem/GMFilesystem_Documentation.1.5.pdf.

Good luck and godspeed in improving the minutiae of your games!
« Last Edit: January 11, 2016, 01:59:23 PM by Kyir »