Hi guys,
I have a small question, are we able to "sync" save files to more games? Like we have "game1" and "game2", a player has played "game1" and starts playing "game2", he has the same amount of money and the same armour.
Is there a way to do this?
Do those games have anything in common?
You could simply dump the gold value into a file and read the file from the second game.
Depending on how you implement it would depend on the issues you could encounter.
It definitely is possible to do that with RGSS.
Be sure to version your saves/exports.
Another thing to note is that the file MUST be encrypted in some sort of way.
By Marshal.dumping the value it will do this to some effect, but im pretty sure people can mess with marshalled data without corrupting it.
You might want to create some kind of simple encryption method...
maybe like this...
module Test_Encrypt ENC = { 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9, 9 => 0, } def self.enc(data) new_data = "" data.to_s.split(//).each do |i| new_data += ENC[i.to_i].to_s end new_data end endp Test_Encrypt.enc(999)Edit:
This would avoid people from simply editing the file to give their char ridiculous gold
Edit 2:
The point of this would be to encrypt data BEFORE you dump it. and AFTER you load it.
@Dekita - if you do that, then encrypt the save file of the game too. It's too easy to edit RM save files, so unless you encrypt both of the files, there's not much point in it since if you only encrypt one, I can simply choose to edit the other.
it's definitely not a MUST and as I said above, if you only do it for the gold file to be loaded, then it's kind of useless since the player can just load the file first, then save their new game, then edit the resulting save file...
@mouser,
Its just a personal preference really.
I mean, if the file to store the data is simply called 'Player Gold' and when you open it, it has a vale of 908, you are probably going to be able to deduce that by increasing this value, you will gain more gold.
@Adiktuzmiko
You are correct in stating that it's not a 'MUST', but realistically, if you are doing thins kind of thing ( to allow information to be transferred between games) its best to ensure that your data is going to be as safe as possible.
Also, the encryption method has to be ALOT more advanced if you want to encrypt all save file data before its dumped. you have to take into account every possible character that a script could include. Correct line breaks. Correct translation of text into variables etc..
You should encrypt all save data if you encrypt the gold one... since as I said, if it's only the gold one that is encrypted, then nothing is stopping me from simply just loading it first, then saving the game and modify the new save file instead (which is non encrypted)...
anyway, using marshal.dump won't make the value that shows on the file as 908 directly. so at least it's kind of not too easy to modify using text files, but won't stop an RM user from easily modifying that. For non-RM users, I guess the marshal.dump might be enough to keep normal players from modifying the file. And you can always keep the file on a hidden location just in case
Plus if the argument is that these people can alter the marshal.dumped file without corrupting it, then all the more reason that both files must be encrypted... because again, they can just modify the normal save file which also utilizes marshal.dump, effectively making encrypting only the gold file as useless
Yea, but dumping it via marshal is an encryption method. And a well known one at that.
Really, there are many ways you could achieve such a feature and additional encryption isnt really a requirement. Just a personal preference.
The last time I tried to make a full encryption method, I encountered various issues with reloading the data :/
Mainly due to having the variables correctly reinitialized from a text file 🙁
Dont think I even have that project any more ^_^
I think I found it out a bit, now I'm wondering if it's possible to store this data on a server so players can't edit it? Saves me a lot of time creating the encrypt script.
you can always put the position of the Marshal file in the System folder who when you encrypte the game it hide the system folder ...it is a good way to make you file protect rigth?