Load/Save Question

harlin36harlin36 Member Posts: 101
edited November -1 in Working with GS (Mac)
How do I stop the load attribute overriding the reset game attribute?

I want all the attributes at zero when I press reset game.

Any help appreciated.

Comments

  • The user and all related content has been deleted.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    As in, you will have a menu and when the user presses the reset game button, it changes it back to as if the user had never played the game before?

    If so, in your reset button, you have to change every saved attribute back to what they were originally and then save them, make sure you add a small timer after the change attributes before the save attributes so it doesn't misfire.

    Ace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    In more detail...

    If you have an attribute called 'score'. At the end of the game, you would save the attribute with the key 'score'. This will also be loaded at the end of the start of the game with the same key.

    When the user presses the reset button, you would change the 'score' attribute to 0; then add a timer 'after 0.1 seconds' save attribute 'score' with the same key.

    Ace
  • harlin36harlin36 Member Posts: 101
    I want to put the reset button at the end of the game, as the game is on one giant scene.

    And I want the save/load to kick in every time you play until you finish the game.Is it possible to

    have just one reset button at the end of the game?

    Thanks for your input guys.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Yeah, easy...

    Just when you get to the end of the game, do what I said above :)

    Ace
  • harlin36harlin36 Member Posts: 101
    In my game I collect items that are then displayed on the screen. When the reset button is hit I am still getting the items displayed on the screen. I did what you suggested and have this under my Reset Actor: Rule -> when touched -> reset game -> change attribute game.item to 0 -> Timer after 0.1 sec -> Save Attribute game.item Key GI - end of Rule

    I have then put the Key GI as a load attribute under the load actor.
    Is this correct or am I totally missing something.

    Thanks for your help
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Without looking at the project, I can't say for sure, but you may need to move the X & Y positions off screen or destroy the actors, I'm not sure without seeing it. If you want to send the project to band@ellerker.net I can help you or I can screen share over Skype if you don't want to send out your project.

    Ace
  • harlin36harlin36 Member Posts: 101
    Thanks for your help Ace, I managed to get my head around it in the end.

    Thick as a plank!

    Cheers
Sign In or Register to comment.