Force Save[Resolved with 2 ways]

Started by G_G, January 18, 2009, 07:56:53 pm

Previous topic - Next topic

G_G

January 18, 2009, 07:56:53 pm Last Edit: January 19, 2009, 02:26:00 am by game_guy
Okay well I know how to force the player to save his game.
Like I can actually make him have to save the game before he can move on.
But thats not what the request is.

I want to be able to force the Game itself save without going into the save screen. I want to be able to use a syntax like this or something.

ForceSave(Slot # Here)

Where slot # here is what slot number the script saves the data to.

I don't know if this script is possible but it would work perfect for my star wars mini project.

Thanks in advanced.

Aqua

Um... isn't this... basically... built in...?


    file = File.open(filename, "wb")
    write_save_data(file)
    file.close


Took that from Scene_Save.
That's basically what happens when you decide to save in the slot from the regular save screen.

G_G

January 18, 2009, 11:29:44 pm #2 Last Edit: January 18, 2009, 11:31:28 pm by game_guy
Doesn't work.

Starrodkirby86

January 18, 2009, 11:31:51 pm #3 Last Edit: January 18, 2009, 11:59:20 pm by Starrodkirby86
Quote from: game_guy on January 18, 2009, 11:29:44 pm
Okay thank you!

But how do you decide what slot it is?

I think it's stated right there...
  def on_decision(filename)
    # Play save SE
    $game_system.se_play($data_system.save_se)
    # Write save data
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close

Except you need to replace the savedata of that with SAVE001 or whatever the savefiles are named? Simple assumptions for the win...

And to accommodate your edited post, can't you launch this with a Call Script?

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




G_G

I used Script Call and it crashed

And I'm not quite getting what you posted?

Starrodkirby86

Talking with Aqua, I just decided I might as well use my extensive resources and search for this problem, since I would figure there'd be something on this case (Playing Phoenix Wright >_>; ).

So I found a topic on .ORG that has the solution. Thanks Zeriab!

http://www.rmxp.org/forums/viewtopic.php?f=8&t=53216&p=504504&hilit=force+save#p504504

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Zeriab

I had forgotten I made that >_>
I would suggest using this instead
class Scene_Save
  def self.save(file_index)
    save_obj = self.new
    file = File.open(save_obj.make_filename(file_index), "wb")
    save_obj.write_save_data(file)
    file.close
  end
end


The syntax is: Scene_Save.save(slot)
For example Scene_Save.save(0) saves to the first slot and Scene_Save.save(3) saves to the last slot.

*hugs*
- Zeriab

G_G

Thanks Zeriab!

Wierd thing is I used the event syntax and put it into a script. Then I customized it a little. This is actually much better. Thanks!

*powers up*

Fantasist

January 19, 2009, 07:18:38 am #8 Last Edit: January 19, 2009, 07:19:52 am by Fantasist
@Zeriab: Might I ask, why make a new object? Wouldn't something like this do?


class Scene_Save

  def self.save(file_index)
    file = File.open(make_filename(file_index), 'wb')
    write_save_data(file)
    file.close
  end

end


EDIT: nvm, I got why, I'm so stupid >.<
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Calintz