Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: ClaudeHuggins on February 25, 2018, 05:32:29 pm

Title: On Animations and Game Detection
Post by: ClaudeHuggins on February 25, 2018, 05:32:29 pm
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.



I hope these aren't TOO simple to justify asking. Thanks in advance!
Title: Re: On Animations and Game Detection
Post by: lilbrudder917 on February 25, 2018, 05:57:16 pm
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 (http://www.mundo-maker.com/t10299-xp-gif-player-icons-gif-script) (link is in Spanish and I haven't used it personally). For animated monster sprites, I was able to find this (https://www.rpgmakercentral.com/topic/464-animate-enemies/), 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.
Title: Re: On Animations and Game Detection
Post by: ClaudeHuggins on February 25, 2018, 08:20:23 pm
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!!!