Best Practices for Adding New Data to Saves
#1
I'm currently beginning work on a significant collection of scripts, which adds significant functionality to an RM game- but also handles a large amount of new data that doesn't exist within the default scriptset of RPG Maker. Is there a best practice for adding new data- while retaining compatibility?

Basically, what I'm seeking to do is define a new set of data within the save file that handles another set of variables, and I don't want to conflict with existing scripts or access variables accessible in the RM GUI.
[Image: TohsakaDono.png]
Reply }
#2
Aliasing would be best, and I do have a method of sorts you may wish to look at: Game Data Sneak. That may not work COMPLETELY with VXAce, due to its use of a new manager class for the data... but it is a start.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#3
It depends on what you're asking? What you're talking about my instinct was handling "header" data for save files. In VXAce, instead of accessing the main body of saved data in actors, system, etc, it creates a set of data that's used for showing in the save menu.

This is in the DataManager module for my own game, albeit slimmed down:
PHP Code:
<?php 
def self
.make_save_header
header
= {}
header[:characters] = $game_party.characters_for_savefile
header
[:partysize] = $game_party.members.size
header
[:playtime] = $game_system.playtime
header
[:location] = $game_map.display_name
header
[:day] = $game_variables[4]
header[:image] = $game_variables[5]
header
end
Through this, I can access particular information (like specific variables) in the save file display.

However, if you're asking specifically about just saving that data, then I'm not sure what to suggest. I've honestly always just aliased related inits of certain Game_ classes, like System for general things. I've avoided creating whole new modules or classes because of how older RMs treated them in the past. As I recall, if you didn't save and load data in the same order in RMXP, it would cause problems. (Never mind data being absent.)

Of course, checking the Game Data Sneak script/tutorial link, that could be a method around it. It performs the aliasing of Game_ classes without bogging them down. As for the save/load for RMVXA, I suspect it avoids the issues RMXP has: make_save_contents and extract_save_contents in DataManager look a lot more efficient than RMXP's method.
PHP Code:
<?php 
def self
.make_save_contents
contents
= {}
contents[:system] = $game_system
[...]
def self.extract_save_contents(contents)
$game_system = contents[:system]
[...]
Reply }
#4
Looks like aliasing the make/extra save contents did the trick. Thanks guys.
[Image: TohsakaDono.png]
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,928 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   Adding more stats that behave like SP Bennerdeben 8 9,842 07-24-2020, 02:49 PM
Last Post: Bennerdeben
   The Self Data Suite support thread PK8 0 3,701 07-18-2015, 09:41 PM
Last Post: PK8
   Importing previous data to a 'sequal' fgsfds 1 4,321 05-06-2010, 07:35 PM
Last Post: deValdr
   Adding new Stats? shintashi 2 5,678 03-27-2010, 11:42 PM
Last Post: Victor Sant



Users browsing this thread: 1 Guest(s)