Upgrade page for game with multiple boards

I have a game I'm creating where I will have an upgrade page where people can purchase upgrades during the game. The problem is that going to the upgrade page will happen from any number of different scenes and when I come out of the upgrade scene I want to go back to where I came from. I can't seem to figure out how to do this easily. Can anyone help?
Thanks,
Dan

Comments

  • TheGabfatherTheGabfather Member Posts: 633
    You can take note of the current scene you're in (e.g. via an Index Attribute).
    When you access the Upgrade page, do a normal change scene.
    Afterwards when exiting, just create a Rule that changes the scene to the last visited one depending on your custom index attribute (so it has to be a game attribute which is global).
  • chipcustomizerchipcustomizer Member Posts: 2
    Gab - thanks for the help. I created an attribute called MyScene and set the attribute using an actor in the scenes that call the upgrade page, but when I try to put the logic in for my "continue" button from my options page and choose a behavior of Change Scene, all I have is a Go to Scene drop down of scene names, doesn't look like I can tell it to go to scene "Value of MyScene". Is there another behavior I should be using or can you give me the details? Thanks again for the help.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2014
    @chipcustomizer There isn't a way to use an expression/attribute to automatically change to the referenced scene.

    You'll need to make a rule for each possible value and use the Change Scene drop-down menu to select the scene names:

    When attribute game.MyScene=1
         Change Scene [first scene name]

    When attribute game.MyScene=2
    Change Scene [second scene name]

    etc.

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

  • chipcustomizerchipcustomizer Member Posts: 2
    Tatiang,
    Thanks a lot - that will definitely work and I can do that. The only problem I have is that if I have a game that has 100+ levels it's a bit of a pain that I have to add that in for every level. Perhaps that would be a good RFE for game salad to add so that someone wouldn't have to do that and could put an expression in the change scene drop down.

    Thanks again and if you think of any other way this could work or if anyone else has any other suggestions please let me know.
  • TheGabfatherTheGabfather Member Posts: 633
    edited January 2014
    If you might potentially have 100+ levels to your game (even just 25), it might be a wise decision to create a single-scene game instead. I wouldn't even dare attempt to create 100 scenes for one game.

    edit: but yes, I agree it would be nice to have that feature you're asking for. I'm pretty sure it will come in a future build.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I was going to suggest a single scene also. If the scenes can be automated in a single scene area, this is a no-brainer. If not, you'd make a scene 10x wider and longer than the normal scene and then change the camera origin each time a level change is needed. The nice thing is that you CAN use expressions to change the camera origin so you can achieve the same 100 change scene behaviors with a single change attribute behavior.

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

Sign In or Register to comment.