GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Question about "save attribute"

lowskilowski Posts: 25Member
edited November -1 in Working with GS (Mac)
I'm trying to make checkpoints for my game at the end of every level and i have a question about the save attribute feature. I have two save attributes that save both the x and y positions of my player controlled actor. When the actor overlaps with an area the player is prompted to save their progress and proceed to the next level by pressing the up button. In the save attribute section there is an input box for the attribute to be saved and then there is a "key" option. My question is about the "key" box. Can I leave it blank? If not, what am I supposed to put in there? These questions also apply to the load attribute feature as it also has a "key" option. Oh and I don't have the express version of GS so that means that I cannot test the save and load attributes right?

Comments

  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    The key allows you to load the saved data to any other attribute in the game, not just the one that it was saved from.
  • lowskilowski Posts: 25Member
    I'm not sure I understand. What would be the point of that?
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    I could see it used to hold swap values...

    Rule:
    If game.currentScore > game.highScore1
    ---Change game.highScore1 to game.currentScore
    ---Load Attribute: "High 1" to game.highScore2
    ---Load Attribute: "High 2" to game.highScore3
    Otherwise:
    ---Rule:
    ---If game.currentScore > game.highScore2
    ------Change game.highScore2 to game.currentScore
    ------Load Attribute: "High 2" to game.highScore3
    ---Otherwise:
    ...etc
  • lowskilowski Posts: 25Member
    Ah, I see. But would my setup work if I leave the key section blank?
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    There would be no way to load a saved attribute not assigned to a key, so no.

    Think of saving/loading an attribute as using a safety deposit box. You have to manage both putting stuff in and taking it out, and both operations need a key*. Would you expect documents stored in a safety deposit box to instantly be back in your briefcase then next time you need them?

    * And your SSN, DOB and Mother's maiden name... ;-)
  • lowskilowski Posts: 25Member
    Well that makes sense. But it's prompting me for a key, the key is just some word? I don't understand how a word matters in loading my actors latest saved location...
  • chosenonestudioschosenonestudios Posts: 1,714Member
    pick any word you want for your key... Just make sure when you enter it in... Its exactly the same on both ends...
  • lowskilowski Posts: 25Member
    Okay, thanks :D I was just wondering if there was more to it than what it seemed.
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    Nope, it's exactly what it seems. You have as much control over the naming of keys as you do attributes.
This discussion has been closed.