Reseting Attributes

ars914ars914 Member Posts: 115
edited February 2012 in Working with GS (Mac)
Hi everyone! I am having another problem. Again this probbally gets asked a lot because it probbally isn't too difficult! But my problem is that my attributes won't reset when you die. So I think the problem is I have a save attribute put in and that's telling everything to save and then there is the change attribute and it just won't change. Is there something I have to do?

Thanks,
ars914

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    you have to save the change as well, otherwise it will just use the last save it was told.
  • ars914ars914 Member Posts: 115
    edited February 2012
    @SlickZero How do I do that?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    After you die, and the attribute changes again, use a save attribute after the attribute change.

    Have you seen this Cookbook video?
  • ars914ars914 Member Posts: 115
    Thats not working for some reason...
  • ars914ars914 Member Posts: 115
    Any help?
  • 3xL3xL Member Posts: 676
    use save attribute to save it to a key. MAKE SURE you spell the key correctly when using the load attribute to load it.
  • ars914ars914 Member Posts: 115
    I have the save attribute already used though. I have it so when you exit the game the it saves everything that was going on. But it is still saving them when you die. What should I be doing, what am I doing wrong?
  • ars914ars914 Member Posts: 115
    I already have that but I have a save attribute so it saves the other attributes for when you quit, no when you die. What am I doing wrong?
  • ars914ars914 Member Posts: 115
    edited February 2012
    Does anybody know how to do this? I'm sure most of you guys do! I really need this answer fast because I need to publish my game and this is the last problem! PLEASE HELP!
  • ars914ars914 Member Posts: 115
    Anyone?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Well for a start only save what you need to save, i.e. best score

    When you die, what ever you use to trigger your death screen, have a rule that when die = true, change attribute (whatever attributes have been changed) and the reset the scene.
    Then on your main menu, have a load to load any saved attributes that need to be remembered.

    Save and loads are only for when you close your app down so you should only save stuff that needs to be remembered next time you start your game.
  • ars914ars914 Member Posts: 115
    @beefy_clyro, Don't I need everything to save when you exit the app in the middle of a level though. Like if your on level 20 and have 3 lives and you exit the app, does it automaticly save the score and everything?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    No of course not, no game does that, even on consoles! Game data is generally saved at the end of a level.

    You'll need a couple of attributes;

    WhatLevel
    Life

    When you compete a level, change the WhatLevel to WhatLevel you have unlocked and save that. Load it on main menu.
    Life, when the player dies, reset the scene changing thing like life back to 3.

    If you set the attribute for example on lives at 3, if you turn off and come back, it will go to 3 again but the user will need some way of starting up at the last unlocked level. You can control this through saving nd loading the unlocked level.

    Watch the video that Slick posted above, also then look at the cookbook videos and watch the video on saving and loading!
Sign In or Register to comment.