Save/Load Attribute conflicts
Hey guys --
I'm really close to publishing my new game, but one of the things that's holding me up is a simple save/load attribute. I've used them on previous games with no problem (in previous version of GS), but something is going wrong with my current design:
I have two different attributes I'd like to save/load, and one of them is to keep track of the number of levels unlocked (integer), and the other is to save/load a high score.
I've got my levels unlocked load/save working well. It keeps track of the "unlocked levels" when the game is relaunched. The problem is when I try to save/load an "high score" attribute, it overrides/rewrites my "levels unlocked" attribute. In other words, if my levels are unlocked up to 38, and the high score is 15, then the next time I relaunch, my levels are unlocked at 15 and my high score is also 15.
I've tried to do the high score so many different ways, it's not funny. I've deleted the high score attribute and rewritten it -- I've tried it as an integer, as a real, you name it. I've tried using the same actor to load both attributes, separate actors to load each attribute, I've tried loading on separate scenes, loading in the same same scene, and it's ALWAYS the same outcome. I use "keys" properly; my unlocked levels attribute key is "unlock" and my high score key is "hiscore"… but for some reason, the high score keeps overwriting the unlocked levels.
Does anybody have an idea of what's going wrong here? Why are these save/loads conflicting?
Thanks!
David
I'm really close to publishing my new game, but one of the things that's holding me up is a simple save/load attribute. I've used them on previous games with no problem (in previous version of GS), but something is going wrong with my current design:
I have two different attributes I'd like to save/load, and one of them is to keep track of the number of levels unlocked (integer), and the other is to save/load a high score.
I've got my levels unlocked load/save working well. It keeps track of the "unlocked levels" when the game is relaunched. The problem is when I try to save/load an "high score" attribute, it overrides/rewrites my "levels unlocked" attribute. In other words, if my levels are unlocked up to 38, and the high score is 15, then the next time I relaunch, my levels are unlocked at 15 and my high score is also 15.
I've tried to do the high score so many different ways, it's not funny. I've deleted the high score attribute and rewritten it -- I've tried it as an integer, as a real, you name it. I've tried using the same actor to load both attributes, separate actors to load each attribute, I've tried loading on separate scenes, loading in the same same scene, and it's ALWAYS the same outcome. I use "keys" properly; my unlocked levels attribute key is "unlock" and my high score key is "hiscore"… but for some reason, the high score keeps overwriting the unlocked levels.
Does anybody have an idea of what's going wrong here? Why are these save/loads conflicting?
Thanks!
David
Answers
I'm still curious as to why the GS glitch was occurring in the first place, though. But hey -- now I know table basics. And perhaps I'll be inspired to learn even more about them now that they aren't so scary.
-D