Forced Save? - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Code Support (https://www.save-point.org/forum-20.html) +--- Thread: Forced Save? (/thread-2906.html) |
Forced Save? - Yin - 04-18-2009 I tried to force a save using file = File.open(filename, "wb") write_save_data(file) file.close in a call script, but I keep getting a name error in the interpreter for the word filename. How exactly am I supposed to do this without using a full script. I only want it to force a save at the end of a chapter and when using certain items. So I don't really need a full script for this. [Resolved] Forced Save? - DerVVulfman - 04-18-2009 My dear Yin, You may not need a full script for this, but allow me to present one to you just in case. Punk himself penned it. XP - Force Save before something I believe you merely call $scene =Scene_ForceSave2.new to bring up the save screen where you choose what slot to use. [Resolved] Forced Save? - Yin - 04-18-2009 Ok, this works, but how will I make it automatically save over the slot that is in use... To prevent cheating. So I don't want the player to choose. I mean, they can still cheat if they put their mind to it and save in a different slot before using the item then it forces the save over the slot while they can still load the other save. [Resolved] Forced Save? - DerVVulfman - 04-18-2009 Ah. So what you are doing is making it so the player starts a game with a specific save slot which he uses throughout that one game. If he decides to start over, he can use the second slot (as an example), but your savegames can only be performed in the slot you started with. Is that the case? You start off by having the game force an initial 'save' before the story starts? [Resolved] Forced Save? - Yin - 04-18-2009 If I have to. That makes more sense. So how would I make it so that it forces an initial save? [Resolved] Forced Save? - DerVVulfman - 04-18-2009 Well, for an initial 'SAVE" at the start of the game, you should also store a variable/value like $gameslotnumber which indicates the save slot you're using. It'll be based on the index of the save slot window. You would acquire this same $gameslotnumber when you load a game from the title screen, so this number will be in memory for any and all 'saves' you use. I guess this makes it so saves are even easier as you only can use one slot. ;) The same one slot throughout the game. And with this one value, you generate the filename, like... Code: #-------------------------------------------------------------------------- [Resolved] Forced Save? - Yin - 04-18-2009 OK, I got the force save when pressing new game part. I just added this Code: $game_temp.save_calling = true on_cancel I put Code: if $game_system.save_count == 0 [Resolved] Forced Save? - DerVVulfman - 04-18-2009 Remember this in Scene_File's update method? Code: # If C button was pressed Code: return "Save#{$gamesaveindex + 1}.rxdata" [Resolved] Forced Save? - Yin - 04-18-2009 Ok, I'll try this out now. EDIT: Ok I got it working! [Resolved] Forced Save? - DerVVulfman - 04-18-2009 Way to go! :) Well, this topic is resolved. |