Advertisement
Vlue

Custom Filenames for Savefiles

Aug 5th, 2012
1,977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.28 KB | None | 0 0
  1. #Custom SaveFile Names
  2. #----------#
  3. #Features: Allows you to set custom save file names that noone will ever see.
  4. #    There are some practical uses! I just don't have any yet.
  5. #
  6. #Usage: Plug and play and customize
  7. #   Things to note... delete/move save files before packing game
  8. #   else those files will go with it! Sillyness.
  9. #
  10. #Customization: Set below, in comments.
  11. #----------#
  12. #-- Script by: V.M of D.T
  13. #
  14. #- Questions or comments can be:
  15. #    given by email: sumptuaryspade@live.ca
  16. #    provided on facebook: http://www.facebook.com/DaimoniousTailsGames
  17. #   All my other scripts and projects can be found here: http://daimonioustails.weebly.com/
  18. #
  19. #--- Free to use in any project, commercial or non-commercial, with credit given
  20. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
  21.  
  22. module DataManager
  23. =begin Customization:
  24.   SAVEFILENAME is the details before the number and extension
  25.   SAVEFILEEXTENSION is the extension of the file, defail is Rvdata2
  26. =end
  27.   SAVEFILENAME   = "SAVE"
  28.   SAVEFILEEXTENSION = "Rvdata2"
  29.   def self.save_file_exists?
  30.     !Dir.glob(SAVEFILENAME + "*" + SAVEFILEEXTENSION).empty?
  31.   end
  32.   def self.make_filename(index)
  33.     sprintf(SAVEFILENAME + "%02d." + SAVEFILEEXTENSION, index + 1)
  34.   end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement