On Animations and Game Detection

Started by ClaudeHuggins, February 25, 2018, 05:32:29 pm

Previous topic - Next topic

ClaudeHuggins

February 25, 2018, 05:32:29 pm Last Edit: February 25, 2018, 05:34:10 pm by ClaudeHuggins
Hello!
I'm only just in recent months getting into the scripting aspect of RPG maker after a few years of studying coding. Also, the first game I've made with a version newer than 2k3.

I have a few questions, more specifically, things I would like to know how to do.


  • My current system uses standard pictures to show character portraits during dialogue scenes (like in a visual novel), and I would like to make them animated (preferably with transparency). A more general form of this question would be, I would like to place an animation on the screen the way I might place a picture.

  • I would also enjoy animated monster sprites in battles.

  • I plan on releasing a demo before the game. Is it possible, despite sandbox limitations, for the full game to detect if the player has played the demo or done X in the demo?



I hope these aren't TOO simple to justify asking. Thanks in advance!

lilbrudder917

Hi! First off, welcome to the forum  :)

Since you don't mention what RPG Maker version you're using, I'll assume it's RMXP (mainly because that's the only one I'm familiar with and can answer). RMXP doesn't natively support gifs for animation, but there are scripts available for that (link is in Spanish and I haven't used it personally). For animated monster sprites, I was able to find this, though I haven't used it myself to know how it works.

For the third question, you can make use of the Application Data folder to create a global directory for your game, regardless of where the player keeps it.
Something along the lines of:
path = ENV['APPDATA']+'/Your Game/'
if !File.directory?(path)
Dir.mkdir(path)
File.open(path+"demo.dat", "w") {|f| f.write("1") }
end

in the demo, and then in the final game checking to see if that file exists. You can take it a step further by storing the save file there, and then loading it into "demo variables" in the final game to see what the player has done in the demo.

In the final game, you could have something like

  read_demo_save_data(ENV['APPDATA']+'/Your Game/demo.dat')
  def read_demo_save_data(file)
    # Read character data for drawing save file
    characters = Marshal.load(file)
    # Read each type of game object
    $demo_system        = Marshal.load(file)
    $demo_switches      = Marshal.load(file)
    $demo_variables     = Marshal.load(file)
    $demo_self_switches = Marshal.load(file)
    $demo_screen        = Marshal.load(file)
    $demo_actors        = Marshal.load(file)
    $demo_party         = Marshal.load(file)
    $demo_troop         = Marshal.load(file)
    $demo_map           = Marshal.load(file)
    $demo_player        = Marshal.load(file)
  end

and see if the player has finished the demo (say, represented by switch 55) with $demo_switches[55]. Let me know if this isn't super clear, I'll try to clarify or make a demo for you.

ClaudeHuggins

Quote from: lilbrudder917 on February 25, 2018, 05:57:16 pm
Hi!


Whoops, forgot to mention. Yes, it's XP. :P

This helps a lot!! I had a feeling file IO would be involved with the third question.

Thanks so much!!!