Problems with Loaded Attributes overwriting each other

thebitmasterthebitmaster PRO Posts: 75
edited November -1 in Working with GS (Mac)
I have two attributes, both global.

Game.LevelsWon
Game.TotalScore

I save each (in different places) using:

levelswon
totalscore

...as the keys.

When I just save and load LevelsWon, it works, and I am able to correctly re-load the correct value on subsequent runs in Viewer. However, as soon as I add in the second one, *both* values assume the value of TotalScore on re-load.

I have double and triple checked all of the following:

o all keys are spelled correctly and the same everywhere

o the correct key is used in every save and load (not the obvious accidental loading of the wrong key)

I've also painstakingly removed *every* Load and Save Attribute from the entire project and re-added them to see if that would help. I searched the XML sources from the command line to find the references, so I *know* they were all gone before I added them back.

Has anyone else seen a similar problem? I've been trying to get my game out the door for the past four days, but I'm leaving for Burning Man on Friday, and I've hardly had time to pack because of this. I *really* want to get this submitted to the App Store tomorrow, but this is standing in my way.

Note also that in their XML, GameSalad is misspelling Load.Attribute as Load.Atribute. :)

Comments

  • thebitmasterthebitmaster PRO Posts: 75
    I just made a very simple project with four buttons to create data for the two variables above, zero the data out, save it, and load it. It exhibits exactly the same behavior. The value for TotalScore is loaded into BOTH variables, despite the fact they are saved and loaded with different keys.
  • thebitmasterthebitmaster PRO Posts: 75
    It was the lack of quotes causing the problem. The key *has* to be in double-quotes, i.e.

    "totalscore"

    not

    totalscore

    The second causes keys to overwrite each other.
Sign In or Register to comment.