Fetch game variables from a save file?

Juryrig

Villager
Member
Joined
Dec 30, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Hi all! I'm new to RPG Maker and am nearing completion of my first game due to inefficient use of switches. :p  The story isn't even remotely finished, and my goal is to make a series of games/episodes to continue the story where player choice is transferred between games. The game is purposely simple from a technical standpoint. As my first try, it is more like an interactive novel with no leveling, combat, or inventory. Player choice is limited to exploring small maps and choosing the flavor of responses in dialogue boxes.

It does, however, incorporate a reputation system using variables: i.e. if you respond sympathetically to character 1, the outcome is variable Char1Rep +1. If you respond selfishly, Char1Rep -1. On future interactions with Character 1, I use a conditional branch and call the variable to determine how the character will respond to the player, i.e. if Char1Rep is > 4. character responds positively.

So my problem is: I want Character 1 to remember how the player treated him in the previous game. I'm looking for advice/input regarding a relatively simple way, (preferably with minimal to no scripting) to transfer over, or somehow call, the Character Reputation Variables from a previous game. I searched for importing save files, but I didn't find much, and most of it seemed to deal with inventory and character level. All I really need to do is move about 8 or so variables from one game to another. 

Anyone have any thoughts on recalling or transferring variables from other games into a new game?

If not, I may just allow the player to choose their reputation with various characters at the beginning of the next game, but I'd really like the player's choices to continue to haunt them in future installments.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
If it's the same profile starting over you could just reset all of the switches and variables except for certain ones. If you mean a different save file you will need a global switch script for this.  
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
First of all, this kind of how-to question should go in the Help subforum for whatever Maker you're using, and this is really important in this case because the Maker you're using will determine what kind of solution you need and what kind of coding syntax to use.

Assuming that you need information from a specific file that you choose at runtime, your best bet is probably to use some of the methods in DataManager to pull the $game_variables (etc.) array, store it into a global variable, and then use that global variable to write over the new game's appropriate value in its own $game_variables array.

Less versatile, but much easier, would be to allow the player to use their old saves in your new game.  You can do this by copying the last map they'll be on into your new project, making sure all the database stuff is consistent, etc., and then removing whatever you don't need from the first project in your second project's files.
 

Juryrig

Villager
Member
Joined
Dec 30, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Thanks for the replies. Great ideas! Sorry for posting in the wrong forum. The program I'm using is VXAce. I hadn't thought about copying the last map over as the first map of the new game and letting players move their old save files over to the new game directory and loading their save to start the game. If it loads the player onto the 'new' map with all of the variables intact, I assume I can then clear any switches and variables I don't need from there, leaving the reputation variables intact, and move on with the next game? 
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Ideally this should be planned from the beginning, because if you change your data base you break the save file from the old to the new game.  Keep that point strongly in mind.

I've moved this thread to VXAce. Please be sure to post your threads in the correct forum next time. Thank you.
 

Juryrig

Villager
Member
Joined
Dec 30, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Thanks ksjp17! 

The database limitation kind of sucks. Good to know, though. I suppose I can attempt to 'retrofit' the old game before I release it. I guess I have some experimenting to do.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
You can add to your data base of course, but if, for example, in Game #1 the weapon you had in ID slot 23 was Gruesome Sword of Never-Ending Night and you changed that to Flaming Scythe of Doom, the engine doesn't know you've changed it.  It goes by the ID number, not the name.  So if you wanted that sword to still appear in the same places, you would have to go through and find every instance of where it had occurred and change it to the new ID.

The other big difficulty can come from changing scripts.  You would need to check those very carefully.
 

Juryrig

Villager
Member
Joined
Dec 30, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I see. So I can add to the database in the new game, so long as I don't alter anything that was carried over from the old game? That's workable. Since its mostly a visual novel, it's heavy on events, variables, and switches, which I can safely delete and change, and light on inventory items, enemies, tilesets, and scripts which I can't delete or alter.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Watch your switches very carefully.  If you have used a switch in game #1, I wouldn't reuse it in game #2 without extensive checking that you are not thereby changing any of the data that has been carried forward.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top