Reset table / reset scene
Manadrunk
Member Posts: 7
Hi everyone
I'm making a game where the player walks to a machine and enters a code. This happens in two different scenes. In the first scene you can click on the machine and in the second scene you see the number pad.
I used this tutorial for the second scene.
My problem is that you can only enter your code once. But you should be able to try as many times as you want to.
Could one of you lovely people help me?
(I'm sorry for my bad English.)
Edit: I've tried to copy a new table over my old one but then I can't write in it. Which makes sense because it's a new table... I just need to know how I can reset the old table or reset the scene everytime one pushes a specific button.
Answers
When your app loads, make a copy of your "master" table and then use the copy in all of your rules. When you need to reset the table, just copy the master back to the "working" table again.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'm so so sorry but I don't quite understand.
"When your app loads" --> So when I change to the scene? Because my number pad is a seperate scene. Does that mean I'd have to create an invisible actor with the attribute "copy table"?
"Master table" --> I did everything exactly like in the video I posted. So I have a TypedTable (Where the typed numbers appear) and a AnswerTable (Where the right combination is saved). Which one is my master table?
Thank you so much for your help!
Sorry, I didn't watch your video before posting. In your initial scene, make an invisible or off-screen actor that does Copy Table [master table name] to [working table name]. For example, if you named your table "TypedTable" then rename it to "MasterTypedTable" and create another table that is blank called "CurrentTypedTable." Then go through and change all of the behaviors and rules that use "TypedTable" and substitute "CurrentTypedTable."
Your master table is just the table with the initial data set up however you want it to start out. Your secondary table (e.g. "CurrentTypedTable") is a blank table that gets populated when you do the Copy Table behavior. To reset everything, you would Copy "MasterTypedTable" to "CurrentTypedTable" again. The idea is that you never touch your master table so it's always pristine.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
So I put this off-screen actor in the scene right before my number-pad-scene. Changed all the behaviors to use "CurrentTypedTable" and made an actor with "Copy "MasterTypedTable to "CurrentTypedTable".
I can delete the numbers when I press the mentioned actor but it won't let me put in a code for a second time.
Edit: I made a new game to test this aspect seperatly. It seems that the copying doesn't work because when I preview the game the blank tiles won't show up. Their images are set to my image of a blank tile whose name I put in the columns of my MasterTypedTable. Since I don't see a picture of a blank tile when I preview the game I assume that the MasterTypedTable wasn't copyied to the CurrentTypedTable.
(Hope you understand what I want to say.)
Does no one know how I could fix this problem?
I don’t know what else to try.
I don't know if this demo would be helpful to you but I set it up as simply as I could. Click on a white button to change the value of that table row to zero. Click on the blue reset button to copy the master table back into the game table.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you but unfortunately I can't open the file. It says that the file is newer than my version of gamesalad.
Sorry, I didn't see that you were using Windows Creator. I made the demo in Mac Creator 0.12.10.
It sounds like you may need to do some debugging of your file by displaying the table data on-screen while previewing the file.
I've attached a video of the demo and a few screenshots of the rules and table data. Hope that helps.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User