Master Reset
quinn221
Member Posts: 280
Hi,
I am trying to make a master reset button the resets my game when pressed. I am storing my information in tables ( position, coins, weapons etc.) I added in a button that resets the game but it will not rest my table data.
My change attributes for my table is on my splash screen along with my reset button. Any ideas how to rest the tables.
Comments
The Reset Game Behavior will reset the game and attributes back to their initial state as though the game were launched from the device BUT it will not re-set data in a table. If you want to clear out or reset a table you'll need to do that manually. Usually I'll make two tables for a set of data. One that holds the default information and one that is used to save and load from. Then if you ever want to reset the save/load table you can copy the default table into it using a Copy Table Behavior.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c thanks...but I am still a bit fuzzy on it, do you have any examples? And how would you reset a saved attribute
I'm afraid I don't have any tutorials or samples.
I don't know what you mean by 'reset a saved attribute' can you explain?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks Jamie I will give it a try. I have one saved attribute in the game that unlocks levels (based off of a video I watched). Just trying figure out how I reset this this as well when the user resets the game.
@jamie_c OK, I have the reset almost working.... But when I reset using the Defaults my main player comes in at the bottom of the screen
@jamie_c I have been trying different approaches all night still not luck with getting the player to appear back to the correct start position after reset.
Can you take a quick look at my rules. see attached
checkpoint-table.png - this is my saved table data when the hero crosses checkpoints
checkpoint-table reset.png - this is the table that is used to replace the checkpoint table on the reset.
splash-screen reset.png this is a screen shot of my splash screen rules.
Everything works on the reset except for the position when reloading the game, it is almost like it just does not know where to place the actor on the next scene
Not sure where to go from here
https://www.dropbox.com/s/gaizev0ysqfr75u/Archive.zip?dl=0
I'm on my iPad at the moment so I can't get that zip file. But if your player is not in the correct position when the level begins for whatever reason you can manually set that if you have to with Change Attribute Behaviors for its X and Y locations.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks Jamie!