Gonor 0 Report post Posted March 12, 2011 Hello there, I'm looking for an RGSS2 script with which I can change a file's name during the game. It's not entirely neccessary but it would make one of my planned plot twists much much easier. :alright: Thx. Gonor Share this post Link to post Share on other sites
brewmeister 3 Report post Posted March 12, 2011 (edited) from the help document... Help -> Contents -> RGSS Reference Manual -> Standard Library -> Built-in Classes -> Object -> IO -> File File.rename(from, to) Renames file, moving it to a different directory as required. If a file already exists at the destination, it is overwritten. Returns 0 when file movement is successful; when it fails, throws an Errno::EXXX exception. It's already built in. The root folder is your game folder, so if your file is in the game folder... File.rename("myfile.txt", "renamed.txt") If it's in the Data folder, for example... File.rename("Data\\myfile.txt", "Data\\renamed.txt") Edited March 12, 2011 by brewmeister Share this post Link to post Share on other sites
Broken Messiah 20 Report post Posted March 12, 2011 Huh, I didn't know it was that simple, but wouldnt doing that make replaying the game impossible? Share this post Link to post Share on other sites
joman195 9 Report post Posted March 12, 2011 At the beginning of the game have it rename it back to the original. Share this post Link to post Share on other sites
Gonor 0 Report post Posted March 12, 2011 (edited) Great! That's exactly what I was looking for. Thanks a lot. Edit: It just came to my mind, that I would have to adapt the script so it will check for the game's progress, so the file is renamed properly when loading. Ah, well... I guess I'll have to try and write a little more than just a script call. :P Edited March 12, 2011 by Gonor Share this post Link to post Share on other sites