• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Save File Calls

Resource Save File Calls 2022-12-16

TechSkylander1518 submitted a new resource:

Save File calls - Code that lets you read one game's save file to do something in another!

View attachment 6691
(The Last Nurse Joy)

A simple script to check for save files from other games and use that data to give the player a reward!
Inspired by features like BW2's keys, Ranger's Manaphy Egg, Mario Kart Wii giving you Rosalina if you played Galaxy, etc.​


Code
Paste in a new script section above main!
Ruby:
def...

Read more about this resource...
 

AenaonDogsky

Arbiter of Doggos
Member
Joined
Dec 12, 2017
Posts
501
Hey Tech, seems like certain Project Title characters that contain symbols like ":" are converted into underscores "_" in the Saved Games folder path (natively by RMXP).

For instance, a project titled Titlehere: Subtitlehere (as indicated by its .ini file) would actually be named Titlehere_Subtitlehere in the path.
Does this interfere with the script in any way? I am not sure if this applies to 19.1 savefiles, but since the script can also read v18 files, it's relevant.
Also, is the script itself compatible with 18.1?
 
Last edited:
Hey Tech, seems like certain Project Title characters that contain symbols like ":" are converted into underscores "_" in the Saved Games folder path (natively by RMXP).

For instance, a project titled Titlehere: Subtitlehere (as indicated by its .ini file) would actually be named Titlehere_Subtitlehere in the path.
Does this interfere with the script in any way? I am not sure if this applies to 19.1 savefiles, but since the script can also read v18 files, it's relevant.
Also, is the script itself compatible with 18.1?
Oh, thanks for catching that! Yeah, the main thing is the filepath, so do whatever the folder's name is!

The script can't be used in earlier version yet, unfortunately, I'm not yet familiar with v18's save system, but I'll look into it!
 

AenaonDogsky

Arbiter of Doggos
Member
Joined
Dec 12, 2017
Posts
501
Oh, thanks for catching that! Yeah, the main thing is the filepath, so do whatever the folder's name is!

The script can't be used in earlier version yet, unfortunately, I'm not yet familiar with v18's save system, but I'll look into it!
Cool! The thread description still mentions:
Name is the name of your game, just like it is in Game.ini. Should be a string. (In quotes)
As far as old version compatibility is concerned I guess the most important thing would be reading a global variable and/or a switch, if figuring out the older save system proves to be too much of a hassle. Has v19 significantly changed save structure?
 
As far as old version compatibility is concerned I guess the most important thing would be reading a global variable and/or a switch, if figuring out the older save system proves to be too much of a hassle. Has v19 significantly changed save structure?
(Sorry about the late reply, thought I had responded to this sooner!)

Yeah, it's been a pretty major change, actually- Savordez actually has a whole guide on it here. The biggest thing is that it's gone from an array to a hash, so data has to be accessed in a specific order rather than with a key. It shouldn't be too hard to get working, it'll just take some time to learn it!
 

AenaonDogsky

Arbiter of Doggos
Member
Joined
Dec 12, 2017
Posts
501
(Sorry about the late reply, thought I had responded to this sooner!)

Yeah, it's been a pretty major change, actually- Savordez actually has a whole guide on it here. The biggest thing is that it's gone from an array to a hash, so data has to be accessed in a specific order rather than with a key. It shouldn't be too hard to get working, it'll just take some time to learn it!

Oof, gotcha. Not really worth the hassle xD
 

hooperfreak

Rookie
Member
Joined
Jan 18, 2023
Posts
1
Hello! I recently have tried using this plugin on v20.1 to get data from a v19 game. Once the v20 game transfers the v19 player's lead pokemon, the save data of the v19 game stops working. I get an error that says "Script 'Savadata' line 28: ArgumentError occured. undefined class/module DayCare"

That's literally it. Then the old game crashes. If I back up the save file from the v19 game and reload it, it works fine. Its only after I do the transfer with this plugin, it breaks my old save. Please let me know if you have any idea what the fix may be.
 
Hello! I recently have tried using this plugin on v20.1 to get data from a v19 game. Once the v20 game transfers the v19 player's lead pokemon, the save data of the v19 game stops working. I get an error that says "Script 'Savadata' line 28: ArgumentError occured. undefined class/module DayCare"

That's literally it. Then the old game crashes. If I back up the save file from the v19 game and reload it, it works fine. Its only after I do the transfer with this plugin, it breaks my old save. Please let me know if you have any idea what the fix may be.
Ah, geez, I knew I had had a couple times playtesting where it converted old files, I thought I had fixed that issue. Just to be sure, you're using the v20 version of the script, right? (Line 8 should be save_data = SaveData.get_data_from_file(file), not save_data = SaveData.read_from_file(file) like in the v19 version)
 

Gardenette

Cooltrainer
Member
Joined
May 30, 2022
Posts
156
Hey Tech,

Love your work with this script and in general. Just wanted to ask - am I using this correctly?
pbSaveTest("project-untamed",switch,82,ver=20)

To be fair, I am trying to check if a switch is turned on in another save file for this same game. I know it's on your list to make it compatible with multiple saves for the same game. Just wanted to know if I've got the syntax correct here because I get this error:
1676740281146.png
 
Hey Tech,

Love your work with this script and in general. Just wanted to ask - am I using this correctly?
pbSaveTest("project-untamed",switch,82,ver=20)

To be fair, I am trying to check if a switch is turned on in another save file for this same game. I know it's on your list to make it compatible with multiple saves for the same game. Just wanted to know if I've got the syntax correct here because I get this error:
View attachment 15729
There should be quotes around switch to make it a string instead of a variable. I'll update the instructions to be a little more clear.

And thank you for the kind words!
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
Oh, with this you could replicate the keys from Black2 and White2! They kind of worked like this script lets you.
And also those offline battles in certain buildings that let you fight against the team of someone you connected with...
You could even make the option for people to load the data of a friend that is playing the game at the same time and have a follower trainer with their data and make it look (sort of) like you're playing coop.
Uh... this opens so many possibilities...
 

Eurritimia

Novice
Member
Joined
Mar 20, 2019
Posts
48
I tested this on v21 and it does work as intended. I had to alter the when 20, 19 by adding 21 on it. I'm just curious to know if there are more stuff from saves we can use.
 
Back
Top