Do we have any scripts that serializes data in text format rather than Marshal's binary format?
Could be any serialization format from XML to JSON to YAML to your own thing.
Is there anything that we can pull from existing ruby libraries?
What I am looking for is an alternative serialization to Marshal.
So for example you have your $game_actors object. When you call save_data($game_actors, "actors.rvdata2"), it will use the custom serialization format.
When you call load_data("actors.rvdata2") it will load it as usual.
Text-based data serialization
● ARCHIVED · READ-ONLY
-
-
I have definitely seen a thread somewhere here about using YAML. Dunno about any of the others.
Could always write your own... :/ -
I only know the json-pure gem. Source is here. But it uses some libraries from Ruby's standard library and the RGSS lacks them. So you have to get pure Ruby versions of those libraries, too.
Maybe you can find those here:
https://github.com/ruby/ruby/tree/ruby_1_9_2/lib
https://github.com/rubysl (misnomer; that's actually the standard library of Rubinius and it might use features that other Ruby implementations don't have)
If you don't want to add all files to the Script Editor, place them in a folder (e.g, Scripts) and add its path to $LOAD_PATH:
$LOAD_PATH << File.expand_path('Scripts')Then require json.
And then you have JSON support to the RGSS classes (Color, Table, Tone, Rect) and rewrite save_data and load_data or better add new global functions (_json suffix, maybe?).
TL;DR: It isn't worth the hassle.