The Dink Network

Reply to Re: Save games and globals

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 14th 2011, 04:01 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
That depends on the language you use, of course, but three things to be aware of:
1) Open the file in binary mode, instead of text mode.
2) Figure out which of the four bytes that are an integer is the most significant.
3) Seth hates (or used to hate) array index 0, so the savegame may only contain 249 variables, with 32 nonsense bytes in front. I think the best way to discover this is to write a small D-Mod that uses as many variables as you can. If string interpolation works in make_global_int, try:

&crap = 0;
loop:
make_global_int("var&crap",&crap);
&crap += 1;
// Except, of course, some more sensible bound, because you'll still need the required globals.
if (&crap < 250)
{
  goto loop;
}


If your primary language is C, then you can look at this wikipage to figure it out.