"Reset scene" makes game to freeze.

I am developing a game, i have two scenes, which are two stages, for now. For some strange reason, when i do "reset scene" on the first one, the game freezes. If i do it on the second one, everything is ok. Any idea on that? :| I don't have anything that makes the game to keep resetting so... what the...? :| it's a bit frustrating. (more than a bit ahah)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you using a Reset Scene behavior? Is that behavior inside of a rule? If not, then the scene will reset when it begins and then reset again and again, etc. If so, what rule condition are you using?

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

  • mangaspraimangasprai Member, PRO Posts: 35
    i Erased all the conditions that caused the crash, then i made a button "actor receives event - touch is pressed"---> reset this scene
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    So did that help or is it still crashing?

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

  • mangaspraimangasprai Member, PRO Posts: 35
    still crashing , even testing it wireless with ipad..
  • 3itg3itg Member, PRO Posts: 382
    Are you using tables?
  • mangaspraimangasprai Member, PRO Posts: 35
    yes, i have a table that inside has values of time, records, score, booleans for stage stars, etc..
  • mangaspraimangasprai Member, PRO Posts: 35
    the second scene, or stage, has pretty much the same actors... it's just a row below in table... and it work.
  • mangaspraimangasprai Member, PRO Posts: 35
    even "reset game" causes freeze :|
  • 3itg3itg Member, PRO Posts: 382
    Make sure that all cells contain data.
    Make sure you never attempt to reference column or row 0.
    Duplicate the Scene, add a third row and point your logic to it?
    Did the duplicate work?

    Do you have a load screen or something that "initializes" or changes any attributes on your way to scene 1?

    Example:
    When my scene loads it changes my players health / armor to CurrentArmor/CurrentHealth.
    The player Dies at 0 armor, 0 health.
    Since my player was getting the health data, I figured it was all good.
    It works once, the player dies... then keeps dying, because its health is 0 after reset scene.
    When coming from the load screen, the player's health is set correctly.
    When coming from a Reset Scene, I needed to change the attribute from 0 to 1 so the player would not die immediately upon scene start.
    Now when player loads in, with 1 health, it immediately updates to the correct health without dying from being 0.
  • mangaspraimangasprai Member, PRO Posts: 35
    thankyou!!! later i try all this and see if it works. Let's try duplicating right now :)
  • 3itg3itg Member, PRO Posts: 382
    Hope it helps, let me know if you further assistance.
  • mangaspraimangasprai Member, PRO Posts: 35
    just duplicating the scene doesn't work.
    AAAlllllright then. Now my time is up, when i have 5 minutes free i try to describe the process the stage does before it starts. :) (table has no empty cells, they atleast have a 0 everywhere, and at first check no cell values are referring to row or column 0, always at least 1). I use , as tab row referral, a value "stagenumber" which by base is 1, and it's set before AND at the start of the stage itself, like: *when you press "next stage" set "stagenumber to itself+1", and to be sure it's correct, it's set also when the stage starts.
    the stage that crashes is the first anyway.
  • 3itg3itg Member, PRO Posts: 382
    Well, if you now have a scene 3, and you pointed your logic to scene 3...
    scene 2 works,
    1 and 3 do not.
    Cool, now we have scene 3 to work with. Start deleting actors from scene 3, testing after each. When you find out that it works after deleting an actor, add back the others, testing after each one. To make sure that those actors are not part of the problem.
    When you find the problem in scene 3, try the solution in scene 1.

    You could also use extensive "Log Debugging Statements" to verify that your attributes are what you think they are.
Sign In or Register to comment.