Search the Community
Showing results for tags 'save file'.
Found 3 results
CGMZ Save File By: Casper Gaming Last Update: 3/1/2021 Latest Version: 1.0.0 Introduction This plugin modifies the save / load screens to show more game information as well as providing additional customization options. Features Adds more information in the save screen Easily customize save screen options like autosave display and save count Screenshots How to Use Import into plugin manager and enable the plugin. Some customization options are available. Further instructions in plugin. Plugin Plugin (along with all my other plugins) can be found here: https://www.caspergaming.com/plugins/cgmz/savefile/ Requires CGMZ Core which can be found here: https://www.caspergaming.com/plugins/cgmz/core/ Credit & Terms https://www.caspergaming.com/terms-of-use/ Version Info
Hello! I was hoping to program a text line in my save files that indicates where the player is at when they save the game. I've created a global variable ($v_player_location) that is set as a string so I can change the labeled "location" on a whim without having to change the map names in the editor. The player interacts with an event, within that event I have $v_player_location set to whatever location name I want it to be, and then the game saves. The "player location" does indeed show on the save files, but the issue here is that the location for every save file is portrayed as the same string because it's reflecting what $v_player_location currently is, instead of what it was at the time of each individual save. I was able to make the save files show individual play times. def draw_playtime(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "play time: " + header[:playtime_s], 2) end As you can see, it uses the symbol :playtime_s It's been a while since I added the play time, so I'm not sure what "header" is referring to, whether its something I created or a system already in place within the RPGMVXA engine. Don't mind me, I'm half asleep. I've found that "header" is referring to the "def self.make_save_header" line within DataManager. I tried to turn the location into a symbol, too, that would initiate upon a new game and set when the player saves. def draw_location(x, y, width, align) draw_text(x, y, width, line_height, "location: " + contents[:plocation], 4) end This did not work. It seems as though I need to figure out how to tell the program I want to access :plocation within contents, but that one line alone can't do it. I probably have to do some version of the line "header = DataManager.load_header(@file_index)" to access :plocation, from what I can tell. Would anyone happen to have any ideas as to how I can grab the contents of a variable for each individual save and display it on the save files? Edit: Here's another piece of the puzzle that shows how the individual play times where achievable. It was also located in DataManager. Interestingly, it's referenced using "DataManager.load_header(@file_index)" instead of "DataManager.load_header_without_rescue(@file_index)". #-------------------------------------------------------------------------- # * Load Save Header (No Exception Processing) #-------------------------------------------------------------------------- def self.load_header_without_rescue(index) File.open(make_filename(index), "rb") do |file| return Marshal.load(file) end return nil end I had a feeling this would dig into the Marshal load/dump/ect; I'm not entirely sure where to go from here, but I'll keep plugging anyway at it. Another Edit: I read up on a similar question someone had, and a person offered a solution to add the variable under header. I was originally trying to place the variable under "contents". Supposedly, this was what would make the variable work. class << DataManager def self.create_game_objects orig_CGO #This works, I'm just not showing the rest of the script here. #MY OBJECTS $v_player_location = "" #blank at the beginning of the game end alias_method(:new_make_save_header, :make_save_header) def make_save_header header = new_make_save_header header[:plocation] = $v_player_location header end end #END CLASS class Window_SaveFile < Window_Base def draw_location(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "location: " + header[:plocation], 4) end end #END CLASS It doesn't, I'm getting an error "can't convert nil into string". This error goes away when I replace header[:plocation] in def draw_location with a string. So that's the issue here. It thinks :plocation is nil, even though I've at least given it a blank string and have it's string changed before a save file is made. Update: This error also goes away when I omit "location " + and keep header[:plocation]. This works well enough for me, but for future sake, I'd like to know why I can include "playtime: " + alongside header[:playtime_s], but not "location " + alongside header[:plocation]. Solution 1: If you're happy with just the variable showing without another string on the same line, this template should work for you. Thank you for reading!
CSCA Save File Plus By: Casper Gaming (Casper667) Last Update: March 5, 2013 Latest version: 1.0.0 Introduction Changes the way the save file selection screen looks. Also has a (very basic) new game + system. Screenshots Basic view of the changes. How to Use Place in your materials section. Plug n Play. Optional New Game + options require setup. Instructions for that in script. Script Text file is found here(copy and paste everything into your script editor in the materials section): LINK Notes One of my very first scripts that I never released outside of my website. If you got it off my website before this post, please re-download it to get the newest version. Credit Casper Gaming Terms http://caspergaming.com/terms-of-use/