Trigger random scene.
How would I go about making a "on touch" leave current scene and randomly pick another scene? So if I have 45 Scenes and Im currently on scene 17. I touch a button actor and it randomly pics one of the 45 scenes.
Comments
On touch, change attribute RANDOM to Random (1,45)
If RANDOM = 1
Change scene to scene 1
If RANDOM = 2
Change scene to scene 2
etc etc
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
http://mynameisace.com/files/Help For Jeff.gameproj.zip
Ace
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
• Make 4 game integer attributes, Pick1, Pick2, PickChoice and FinalPick
• OK, in your Prototype Actor Button in the Inspector Actors section, put the following to pick a random scene and to avoid picking the same scene that you're on:
Rule: When Actor receives event touch is pressed
-A- Change Attribute game.pick1 to random(1,2)
-B - Change Attribute game.pick2 to random(4,45)
---those two change attributes will change depending on which Scene you're on, we'll come to that later)
Change Attibute PickChoice to random(1,2)
Rule: When PickChoice = 1
Change Attribute FinalPick = pick1
otherwise
Change Attribute FinalPick = pick2
Rule: When FinalPick = 1
Change Scene Go to Scene: Scene 1
Rule: When FinalPick = 2
Change Scene Go to Scene: Scene 2
Rule: When FinalPick = 3
Change Scene Go to Scene: Scene 3
-------ETC; all the way to Scene 45
• Now place this button on each of your scenes, making sure to make all of them instances by unlocking them.
• Next is the amendments to each of the Rules in each button, depending on which scene you're in. The following applies to scenes 3 thru to 43:
Change where I've marked A, random so that the max. is the scene before the scene you're on.
Change where I've marked B, random so that the min. is the scene after the scene you're on.
In the Change Scene Go to Scene Rules, just change the one "entry" which will show the scene you're on, to what it should be.
• For scene 1 you obviously don't need A, just B, i.e random(2,45); and scene 45, you don't need B, just A: random(1,44) but still put the result into PickChoice to save you some work.
• For Scene 2, make pick = 1, i.e no random required, and for scene 44, make pick2 = 45, again no random required.
Hope that all makes sense; good luck with it!
:-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
P.S A "thanks" would have been nice. ;-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps