External file weirdness
Posted: Tue Aug 28, 2012 11:18 pm
I have the following happening:
1) A player can create a character.
2) A player can export that character to a file. In this, I am exporting values like the character's name, strength, intelligence, etc.
3) That file can be read successfully
4) The values for the character are populated successfully
So that's RPG stuff, no prob there.
What I think is happening is this: if I declare an array in the game and recompile, suddenly the character info being read contains lots of garbage strings.
So I've got:
- version 0.40 of the game (or whatever) reading and writing characters to disk OK.
- In version 0.41 I declare an array of FatChicks[10] and set it to zero.
- I recompile
- I start the game up, version 0.41
- I can now no longer read the previously-written-to-disk characters.
This seems a little weird to me. But I don't know how it writes those files. I mean, I know what *I* put in them, but is it storing memory addresses as well? Would that explain how things got screwed up?
If I go and create a new character with version 0.41, the newly-created characters import fine.
This isn't a blocker or anything. I anticipated making tens of thousands of characters while developing this game. I am just curious if this seems like reasonable behavior.
1) A player can create a character.
2) A player can export that character to a file. In this, I am exporting values like the character's name, strength, intelligence, etc.
3) That file can be read successfully
4) The values for the character are populated successfully
So that's RPG stuff, no prob there.
What I think is happening is this: if I declare an array in the game and recompile, suddenly the character info being read contains lots of garbage strings.
So I've got:
- version 0.40 of the game (or whatever) reading and writing characters to disk OK.
- In version 0.41 I declare an array of FatChicks[10] and set it to zero.
- I recompile
- I start the game up, version 0.41
- I can now no longer read the previously-written-to-disk characters.
This seems a little weird to me. But I don't know how it writes those files. I mean, I know what *I* put in them, but is it storing memory addresses as well? Would that explain how things got screwed up?
If I go and create a new character with version 0.41, the newly-created characters import fine.
This isn't a blocker or anything. I anticipated making tens of thousands of characters while developing this game. I am just curious if this seems like reasonable behavior.