Dynamic Level Select

SowshSowsh Member Posts: 14

I was able to create a dynamic level select (intended for a game with many levels), but when I preview the game the icons (level 1, 2, 3, etc) all disappear when I come back to the level select scene from either winning or losing a scenario (but they work the first time) and will not respawn.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    This is most likely due to the fact that game attributes do not reset when you use a Change Scene (or Reset Scene) behavior. You have to manually reset their values using one or more Change Attribute behaviors right before the Change Scene behavior.

    As an example, if you start the game on level 1 with game.level equal to 1 and then progress to game.level equal to 3 and Change Scene, game.level will still be equal to 3. So you would do If Touch is Pressed, Change Attribute game.level to 1 ... Change Scene.

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

  • SowshSowsh Member Posts: 14

    @tatiang Even if I change my attribute back to the original setting before a scene change, the level select icons will not respawn in my preview. This may or may not have to do with the way I'm dynamically spawning menu icons (through a timer).

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    This may or may not have to do with the way I'm dynamically spawning menu icons (through a timer).

    Care to say more about this?

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

  • SowshSowsh Member Posts: 14

    @tatiang Working with the Windows version of GS is so frustrating because so much of the functionality of the Mac version just isn't there. There's a limit to creativity...

    Anyway... I'm using a timer to spawn my level select buttons. The timer is supposed to run when the count is 0 and stop when it reaches whatever number, for example 10. This would give me 10 buttons. And it works the first time. But when I go back to the menu again in my preview, none of the buttons stay there. They all disappear and are not clickable. I even tried making a button to click to manually reset that value to zero to try and get the menu to spawn again but it doesn't work.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I even tried making a button to click to manually reset that value to zero to try and get the menu to spawn again but it doesn't work.

    I would think that would do the trick. Did you verify that the attribute in fact changed back to 0? What happens when you add a Log Debugging Statement to the rule with the Spawn Actor behavior? Does the statement/expression appear in the Debugger window both times you load the scene?

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

  • SowshSowsh Member Posts: 14

    @tatiang Let me see if I can work on it and see what the problem is. Thank you for the quick responses.

  • SowshSowsh Member Posts: 14

    @tatiang So it seems like no matter what I do the timer will only execute one time. Is this a known bug with the Windows Creator?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Sowsh said:
    tatiang So it seems like no matter what I do the timer will only execute one time. Is this a known bug with the Windows Creator?

    No. Timers are probably the most reliable part of GameSalad. Maybe post screenshots of your rules/timers? Or better yet, upload your project file to a file-sharing site (.zip it first) and then post a download link. There may be something obvious that I or another person here can spot.

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

Sign In or Register to comment.