Automated forward & back through lots of scenes?
JCFord
Member Posts: 785
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?
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
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.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
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?
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
Darren.