Reseting a Scene

I have a reset button in my game to restart the whole scene but all it does is reset some of the attributes. I want to restart the entire scene, I don't want to just reset a couple of attributes. I don't want to reset the entire game either :O Is there something I'm missing here or is gamesalad not working correctly?

Thanks,
Tad

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    GameSalad has actor attributes (self.name), scene attributes, and game attributes. Game attributes are not reset by a Reset Scene or Change Scene behavior. In order to reset game attributes, you have to do it manually. You can make a boolean game.reset and turn it to true when you want to reset a scene. Then have an actor that -- when game.reset is true -- changes all of the game attributes to whatever starting value you need.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • zoopezoope Member Posts: 210
    @Flamingbanana I found this tutorial by tshirtbooth very helpful in my game.
    Worth a shot

    Cheers :)
  • FlamingbananaFlamingbanana Member, PRO Posts: 90
    @tatiang and @zoope thanks guys. There should be a command to reset scene with the game attributes (just sayin') haha
  • wolltywollty Member Posts: 102
    problem with reset scenes
    I have more scenes
    when I change scene the first time, the scene is reset
    when I change the scene a second time, the scene not restarts from the beginning
    I have more attributes and I'll reset it all (attribute boolean 1, attribute boolean 2)
    maybe I have to use a boolean
    but I can not understand how
    I created a boolean attribute game.reset
    I have one button for to change scene
    when touch is pressed
    change attribute game.reset is true

    when attribute game.reset is true
    ???
    What should I do?

    thanks for help
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you changing the value of game.reset to false after you reset the scene? You need to do this to set it up for the next time the game is "reset."

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • wolltywollty Member Posts: 102
    i have one button for change scene
    rule
    when touch is pressed
    change attribute game.reset to true

    rule
    when attribute game.reset is true
    change scene to next scene

    otherwise
    change attribute game.reset to false


    but so not work (the scene not restart begin)
    where should I put game.reset to false?

    thanks
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You still have to use a Reset Scene behavior if you're not changing scenes. That will restore all actors to their original positions.

    If you are changing scenes and "the scene not restart begin" can you explain what you mean by this? What exactly is not restarting/resetting?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • wolltywollty Member Posts: 102
    maybe
    rule
    when attribute game.correct is true
    change... interpolate... ecc...

    otherwise
    change attribute game.reset to false
  • wolltywollty Member Posts: 102
    i make a puzzle game (4 pieces)

    rule
    when attribute game.correct = 4
    you win

    change attribute game.reset to false


    otherwise
    change attribute game.reset to true
    -------------------------------------------------------------

    in button for change scene
    rule
    when touch is pressed
    change attribute game.reset to true


    rule
    when attribute game.reset is true
    change scene to next scene


    ---------------------------------------

    maybe i put an invisible actor reset in the scene2
    change attribute game.reset is true
    reset scene


    ----------------------------------
    ----------------------------------
    I'm probably missing something that has to do with logic!
    game.reset when is false?
    game.reset when is true?

    game.reset is true when game.correct = 4?
    and where should I put behavior reset scene?

    thanks for help me
Sign In or Register to comment.