Reply to Re: Save games and globals
If you don't have an account, just leave the password field blank.
Oh, PHP can be used for this. True, it's mostly used for dynamic websites, but you can use it to write scripts just like Perl or Python... Either way, search for "reading/writing binary file PHP" (or C#, though if you're unlucky, google may ignore the #). There's bound to be some tutorials about this.
About significant bytes, the integer value of a variable is saved as 4 bytes:
[byte1][byte2][byte3][byte4]
As you probably know, each byte can store values ranging from 0 (00) up to 255 (FF). How to store the number "1" in four bytes? This can be either:
00 00 00 01 -- most significant byte first
or
01 00 00 00 -- most significant byte last
Depending on which byte is the most significant. Similarly, 256 can be:
00 00 01 00 -- most significant byte first
or
00 01 00 00 -- most significant byte last
Finally, 257:
00 00 01 01 -- most significant byte first
or
01 01 00 00 -- most significant byte last
Oh, and I just checked, the boolean for "active" is stored as only one byte (either 00 or 01), but it's followed by three bytes that are all 00, for byte padding reasons. If you don't know what this means, ignore it. Just be aware that the 4 bytes of "active" look either like "01 00 00 00" or "00 00 00 00", even though the first combination of four bytes, when interpreted as an integer might mean 2^24, in case the most significant byte goes first.
I... hope that makes sense.
About significant bytes, the integer value of a variable is saved as 4 bytes:
[byte1][byte2][byte3][byte4]
As you probably know, each byte can store values ranging from 0 (00) up to 255 (FF). How to store the number "1" in four bytes? This can be either:
00 00 00 01 -- most significant byte first
or
01 00 00 00 -- most significant byte last
Depending on which byte is the most significant. Similarly, 256 can be:
00 00 01 00 -- most significant byte first
or
00 01 00 00 -- most significant byte last
Finally, 257:
00 00 01 01 -- most significant byte first
or
01 01 00 00 -- most significant byte last
Oh, and I just checked, the boolean for "active" is stored as only one byte (either 00 or 01), but it's followed by three bytes that are all 00, for byte padding reasons. If you don't know what this means, ignore it. Just be aware that the 4 bytes of "active" look either like "01 00 00 00" or "00 00 00 00", even though the first combination of four bytes, when interpreted as an integer might mean 2^24, in case the most significant byte goes first.
I... hope that makes sense.