Attributes not saving

None of my attributes are being saved. I save them with a key and load them back up in the first scene with that same key but none of them actually load whenever I restart the preview. I use the normal "Save Attribute" and "Load Attribute" behaviors. What can be going wrong?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited August 2013

    Hi @lescobar94 Although there aren't any fixed rules as such concerning saving and loading attributes in GameSalad, there's a tried and trusted way which should give you good results.

    So first to say, it's probably not a good idea to load your attributes in the first scene, if by this you mean the first playable scene....

    Instead, make a menu screen, with at least two buttons, one which is New Game, that'll take you to the first scene when touched; and the other called Continue. When this is pressed, load in your behaviours. The final Load Behaviour will be for your Scene attribute.

    When SceneAtt is 1
    Change Scene YourScene1

    When SceneAtt is 2
    Change Scene YourScene2

    When SceneAtt is 3
    Change Scene YourScene3

    etc.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Save and load doesn't work in the creator preview.
  • lescobar94lescobar94 Member Posts: 25
    @gyroscope What do you mean by "The final Load Behaviour will be for your Scene attribute."?
  • lescobar94lescobar94 Member Posts: 25
    @FryingBaconStudios how can I test it in the iPhone simulator?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited August 2013

    Hi, I mean at the beginning of each scene in your game, (put into a blank actor off-screen), you need a Change Attribute behaviour (text), so for instance: Change Attribute MyScene to scene5
    Then a Save Attribute as you know, i.e Attribute: MyScene Key:scene


    So in the Continue button on the menu screen, when you are using the Load Attribute behaviours, you use all of them, but leave the Load Attribute Key:scene Attribute: MyScene til last.

    Then you need, as prev. mentioned the Rules:

    When MyScene is scene1
    Change Scene Go to Scene: scene1

    When MyScene is scene2
    Change Scene Go to Scene: scene2

    When MyScene is scene3
    Change Scene Go to Scene: scene3

    When MyScene is scene4
    Change Scene Go to Scene: scene4

    etc. Hope I've made the explanation a bit clearer for you.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.