Does save and load attributes work with different attributes?

Can you save the value of an attribute into a key and then load it into a different attribute? Because I've been trying all night but now I realize maybe it isn't possible.

Comments

  • bernardo.chuecosbernardo.chuecos Member, PRO Posts: 75

    Also, does it work between scenes? Like can I save an attribute in one scene and load it in another one?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Why don't you just use a table? If you use a table you can access that data from anything or put it into any variable.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    I have a whole series on tables if you've never used them they are very easy to use.

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

    Hi @bernardo.chuecos Save and Load Attribute Behaviours only work on the device, not in GSC on your computer.

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

  • ArmellineArmelline Member, PRO Posts: 5,364
    edited December 2015

    @bernardo.chuecos said:
    Can you save the value of an attribute into a key and then load it into a different attribute? Because I've been trying all night but now I realize maybe it isn't possible.

    You can save to one and load to another. You are saving to a Key, and loading from that Key. It doesn't matter which attribute the data related to the key is placed in.

    Also, it work between scenes? Like can I save an attribute in one scene and load it in another one?

    Yes, if you are using a self attribute that is one way of passing it between scenes. Using a game attribute is much simpler, though.

    @Lost_Oasis_Games said:
    Why don't you just use a table? If you use a table you can access that data from anything or put it into any variable.

    A table is only beneficial if you have lots of attributes to save. They are better for easier management, but less efficient. If you have, say, 5 attributes, you're better with attributes. If you have, say, 20, then a table will be easier to manage. I normally stick to attributes. Tables are way overrated.

    @gyroscope said:
    Hi @bernardo.chuecos Save and Load Attribute Behaviours only work on the device, not in GSC on your computer.

    This is incorrect, both behaviours work fine in creator.

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

    @Armelline Hi Ted, surely not - if you quit GSC and open again they won't work.... least, they never used to...

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

  • ArmellineArmelline Member, PRO Posts: 5,364
    edited December 2015

    @gyroscope said:
    @Armelline Hi Ted, surely not - if you quit GSC and open again they won't work.... least, they never used to...

    You hit the reset button to simulate the game being reloaded. Exiting preview entirely is akin to deleting the game.

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

    Sorry for my slowness here but what reset button?

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

  • ArmellineArmelline Member, PRO Posts: 5,364
    edited December 2015

    @gyroscope said:
    Sorry for my slowness here but what reset button?

    Next to the pause button :)

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

    Oh, that one! Forgot it was called the reset button, thanks. :smile: Not sure how that works still though if you've saved and loaded attribute behaviours, closed GSC then opened it again - surely reset would do just that - start you at the beginning again...

    Either way, I've been wary of Save & Load game attributes for a while, I use Tables now...

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

  • ArmellineArmelline Member, PRO Posts: 5,364
    edited December 2015

    @gyroscope said:
    Oh, that one! Forgot it was called the reset button, thanks. :smile: Not sure how that works still though if you've saved and loaded attribute behaviours, closed GSC then opened it again - surely reset would do just that - start you at the beginning again...

    Either way, I've been wary of Save & Load game attributes for a while, I use Tables now...

    The way to think about it is like this:

    • When you hit preview, you install the game onto your device.
    • When you hit reset, you exit the game and re-enter it - so it's good for testing saving/loading.
    • When you exit preview, you uninstall the game from your device.

    So you can't test fully - you can't test saving/loading between updated versions of a game. But you can test enough to confirm that your saves and loads are in fact occurring as intended.

    Can't remember which, but a GS staff member confirmed not that long ago that attributes - even quite a few of them - are more efficient than using a table. The big reason to use a table is easier organisation.

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

    I understand now, thanks Ted. :)

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

Sign In or Register to comment.