Load/Save Attributes Not working
GameLabs222
Member Posts: 197
I have options set up in my air hockey game to enable the player to change the color of their paddles. I save the color change with the 'save attribute' function and turn all other colors to false and save those as well. While playing this works perfectly.
But if the match is over/you quit the match/or leave the app weird things start to happen. When the game loads the title actor loads all the save attributes, except it doesn't work. Sometimes when I exit the app and go back, all colors get switched to true, or none are true and they reset to the default colors.
My quit button resets the game, but as far as I'm aware that doesn't reset saved attributes. Nor do I have any other coding that could switch all colors to true unless you pressed the button for the specific color in the options menu which would then turn the other colors to false and save them. It seems like my save and load code is straightforward but it is doing everything it's not coded to do.
But if the match is over/you quit the match/or leave the app weird things start to happen. When the game loads the title actor loads all the save attributes, except it doesn't work. Sometimes when I exit the app and go back, all colors get switched to true, or none are true and they reset to the default colors.
My quit button resets the game, but as far as I'm aware that doesn't reset saved attributes. Nor do I have any other coding that could switch all colors to true unless you pressed the button for the specific color in the options menu which would then turn the other colors to false and save them. It seems like my save and load code is straightforward but it is doing everything it's not coded to do.
Comments
I have over 30 load and save attributes in my game and Load and saves work fine for me.
Maybe this might help:
1))So when the game is over and it changes scene, make sure your save attributes happen before you change scene otherwise this can cause problems.
2))make sure your load and save attributes are the same! Capitals and everything. It's very easy to misplace a letter
3))best to make a little intro scene before your menu scene
In the intro scene is where you load your attributes.
4))basically like option 1, make sure you save your attributes before anything els. The save attribute must sit above the change scene or whatevs.
Basically what I'm trying to say is, gamesalad doesn't have errors like this, it's just how you code it.
GSINVENTION FREE TEMPLATES
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
I also read that you're not suppose to use the expression editor and just type straight into the key field. I changed that and tweaked the timers.
Expression editor for all my actions, not only for save and load.