Save/load attribute problem! Pls help!
Greetings,
So i have a problem with save load attributes. I have 3 attributes that need to be saved, one for unlocked levels, one for pottery counting and one for treasure box counting. I have all three loads at the beginning of the game (intro scene ). The pottery and treasure save are in rules that save the attribute every time the actor is touched By the hero, so for example pottery count + 1 then save attribute potterycount to key "potterycount save" it works fine EXCEPT that when I exit the game and take it out of memory to "restart" the game, I get the last saved count for pottery and treasures, but if I start the game again it restarts saving treasures/pottery from 0 and erases my previous save. How do I get it to just continue adding onto the previous count? Or maybe it can't do that?
As well my unlock levels do not save. I have an integer attribute set for 2 which means the first two levels are open and during the game I have an actor that when touched by the player it should add +1 to that attribute unlocking the next level. It does this for 7 stages and saves the attribute on each stage as I assume that for each +1 it should save onto that initial 2 so by the end the count for all states unlocked should be 9, then saved and loaded next time, however this does not happen, I reset the game and my levels are all relocked, what am I doing wrong?
Thank you very much!
So i have a problem with save load attributes. I have 3 attributes that need to be saved, one for unlocked levels, one for pottery counting and one for treasure box counting. I have all three loads at the beginning of the game (intro scene ). The pottery and treasure save are in rules that save the attribute every time the actor is touched By the hero, so for example pottery count + 1 then save attribute potterycount to key "potterycount save" it works fine EXCEPT that when I exit the game and take it out of memory to "restart" the game, I get the last saved count for pottery and treasures, but if I start the game again it restarts saving treasures/pottery from 0 and erases my previous save. How do I get it to just continue adding onto the previous count? Or maybe it can't do that?
As well my unlock levels do not save. I have an integer attribute set for 2 which means the first two levels are open and during the game I have an actor that when touched by the player it should add +1 to that attribute unlocking the next level. It does this for 7 stages and saves the attribute on each stage as I assume that for each +1 it should save onto that initial 2 so by the end the count for all states unlocked should be 9, then saved and loaded next time, however this does not happen, I reset the game and my levels are all relocked, what am I doing wrong?
Thank you very much!
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
@sugawara
Hi, good points from the other guys. To add, a couple of suggestions:
A more usual situation than the one you have is to have two buttons on your menu/intro card. One is new Game or similar, and this just takes you to your first scene, where you start fresh. the other button, marked Continue, or continue Game, whatever, is where you put all of your Load Attribute behaviours, ending with loading the Saved Attribute behaviour for the scene to go to.
Next to say, a more watertight way of saving and loading scenes, from what I can see from your description, instead of using the integer attribute to save the amount of unlocked scenes, use this to indicate the last scene played, i.e the one to go to if continue is pressed. (You'll still need attributes to indicate which of your scenes is locked/unlocked of course, but by the sound of it, you'd need one boolean attribute for each of the scenes...)
So to carry on talking about the Rules in the Continue button, at the end, you need to put:
When YourInt = 1
Change Scene Go to Scene 1
When YourInt = 2
Change Scene Go to Scene 2
etc
This is the only way at the moment of changing a scene based on a variable, because the Change Scene value can't be changed/amended via the expression editor.
Finally to say, the Save and Load Attribute behaviours don't work in GSC on the Mac (at least, they never used to); to see/check them working, you need to play the game on the viewer on the device, or be runing an ad hoc.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps