2015-03-28 18:59:27

hi all. I have such problem: I do preservation in the game, I create the text file, I write down in it all variables: health, position, weapon and so on. I code all information through string_encrypt (). As usual, I open the file:
file save;
save.open ("save.dat", "rb");
string data=string_decrypt (save.read (), my_key);
alert ("", data);
save.close ();
In attempt of start of such script at me appears or an empty window with the OK button, or some part from contents of the file which I read. Help to cope with this difficulty please. I apologize for the English. I from Russia. For the message the translator used. Thanks in advance.

2015-03-28 19:47:17

Hi,
Try sorting the information read into a dictionary like this:
dictionary data;
// add key sets here
or, use an array:
string[] data;
for (int i = 0; i <= save.size; ++i)
{
// add implementation here...
}
Then for loop it to get its contents.
I am not sure if that method even works, so yeah.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github