Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Copying Files in Ruby

I've been coding in ruby for over a year now, and I'm usually self sufficient, but I'm really clueless right now.

I made a nice load/save scene and I suddenly thought, "Maybe I can add some preview screenshots from the moment when you last saved, that way the player can easily remember his save file and where he left the game." I had no problem with the screenshots. When the player is about to save, he creates a temporary PNG file which contains the screenshot from where he left the game. Theoretically, when he saves, the game should create a copy of the temporary file and rename it "Screenshot ##". I can't simply rename the temporary file because it prevents the game from taking screenshots, in example, of the status menu, if the player revisits the menu screen more than once before accessing the save screen. Also, we must keep in mind the player might want to save in more than one file.

I'm really helpless. If someone could tell me how to copy a file, how to save an image file (RMXP won't let me dump bitmaps, I already tried) or how to work a way around this, I'd be really grateful. Cheers.
 
Thread solved.

I instigated upon other threads that faced similar issues and figured out the best thing to do would be to copy the FileUtils.rb script directly into my project. This way, other people using RMXP won't have script issues with my game.

Here's the link:
http://s88387243.onlinehome.us/rmxp/aut ... leutils.rb

Note that other scripts, such as Wachunga's Auto Font Install script (which I find very useful), also require FileUtils.rb.
 
I'm pretty sure you can copy the ftools contents into the script editor. I can in rmvx, and I've done it with rmxp too. Simply open the ftools.rb in notepad, copy the contents, and paste within the editor, probably towards the top. Just remind them to get that particular script from the demo, or whatever you are doing.

EDIT: You ninja'd me :P
 
medinastories":38jt8j34 said:
Wachunga's Auto Font Install script (which I find very useful), also require FileUtils.rb.
i never found this useful, lots of problems with vista and windows 7, but then again no one likes my solution either(i make real installers for all my games)
 
I think the best possibility is just, that you copy the font inside your project directory and when the user starts the game without installing the font first you print something like "Please install the XY font. The way you have to do that is depending on your operating system. Please use google if you don't know how to do it."
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top