Automated forward & back through lots of scenes?

JCFordJCFord Member Posts: 785
edited November -1 in Working with GS (Mac)
If have 100 scenes in my game from 1-100 and in each of my scenes I have:
a jump forward one scene button and a jump back one scene button
that will take you forward to the next scene or back to the last scene.

I know I could add the easy Change Scene Attribute to the buttons and select the actor in each scene (unlock the padlock) and manually put in the name of the scene from the drop down menu and this would work, but is there would be an automated way of controlling this?

I thought I could create a global game variable called Scene and set it to 1 as the game starts on Scene 1, then have a change attribute on the jump forward one scene button like: game.scene+1 and on the jump back one scene button have: game.scene -1 this would then add or subtract the scene variable so it would correspond to the correct scene. But how can I make it go to that scene?

Its almost like I need a
if game.scene = 5 go to scene 5, but I can't see how to do that?

Comments

  • BeyondtheTechBeyondtheTech Member Posts: 809
    You're basically going to have to build 100 Rules in place, which is why I'm praying the GameSalad gods are listening that a Switch/Case feature will be in place in a near future update.

    I think it'll be something like this:

    Create a Actor with a Prototype that will have the 100 Rules.
    Go to each Scene and add an Attribute that will be the value of the Scene number.
    Set up a Behavior that will Change a Game Attribute to be that of the Scene Attribute.
    When the player touches the Actor (left or right arrow), it will already know which Scene it's in and therefore make the appropriate jump with all the Rules in place.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Yes, I'd make 4 actors each having 25 rules, much easier to deal with. I've got 54 in one actor, and it's pretty much at the limit
  • JCFordJCFord Member Posts: 785
    Am i missing something here?

    Tshirtbooth - where you mention above "change scene to scene 5" that still through the drop down menu right?

    I know I can add the Change to Scene Attribute to each button in each scene but I would have to keep selecting what scene to change to in the drop down menu.

    I was looking for a way to automate this, so I could have just one button and place it in each scene that would simply make it go forward +1 scene and another button that would go -1 scene. Is this not possible?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    No, unfortunately. It would be fantastic if the had a way to concatenate scene names,i.e:

    Change Scene To: "level " + (game.currentLevel+1)

    As it is now, you have to do it through the drop downs. very tedious, but it works.

    Because I am keeping track of lots of things, and in my game you can play any level at at any time, one of my actors has over 300 Rules. Not fun! I would love to change those 300 rules into 3 lines of code... oh well.

    You just have to go get a cup of coffee and plod through it!

    Joe
  • UtopianGamesUtopianGames Member Posts: 5,692
    Crazy that "next or previous scene" hasn't been included yet.

    Darren.
Sign In or Register to comment.