AGS Plugin - AGSE_RESTOREGAME (SOLVED)

Started by lemmy101, Tue 17/01/2006 16:12:33

Previous topic - Next topic

lemmy101

Hi all,

I'm using AGSE_SAVEGAME & AGSE_RESTOREGAME to write/restore data from my plug-in to the save file. However the AGS Plugin API tutorial tells me I "must read in the same number of bytes that I wrote", and the FRead function requires that I pass in the number of bytes I wish to read in... But how can I know this without reading the data in first? :)

I have the size that I wrote in SAVEGAME, but since this is most likely a new instance of my C++ class, and a new instance of the AGS engine, I've no longer got access to this info. Do I need to store the data size in another file? Or perhaps some of the AGS stuff is loaded in by this point and I could set a GlobalInt or something?

Any suggestions will be much appreciated!

SSH

Can't you write the size (in a long, for example) and then write the data, then read the size, then read the data...
12

lemmy101

Quote from: SSH on Tue 17/01/2006 16:25:03
Can't you write the size (in a long, for example) and then write the data, then read the size, then read the data...

Doh! Ahh right I see, I thought I only had the one FWrite/FRead to work with. Thanks!

SMF spam blocked by CleanTalk