My game is completely messed up, I have no idea why :/

HRQPHRQP Member Posts: 26
edited May 2012 in Tech Support
Ok, I think this is GameSalad's fault and not mine, I may be wrong but any help would be appreciated.

Purpose of app:
Effort tracker, record time invested in practicing a song.

Room "A" loads everything before you
get to room B as it should.


Room "B" shows:
*name of song
*name of artist
*total times practiced
*total times performed
*song level
*song next level
*level bar
*Time invested in the song
*Song length
____________________________

I've made other games before and saving/loading is easy, a simple two step process. Now however, Gamesalad has failed to do this so much that I found myself forced to have every single button save every single atribute, and even THEN it doesn't save/load correctly. I've spent three days....three whole days just trying to save about six attributes, I've checked, souble checked, tripple checked, and checked again and again to make sure everything is right, yet somehow Gamesalad refuses to save/load my atributes.

The atributes that refuse to save are the following:

*Song level(intiger)
*Song next level (intiger)
*Song length(intiger)

Those three attributes are saved pretty much after you do ANYTHING, almost any button you press or any action you take will save those attributes, but they refuse to be saved/loaded into the game after you close it. Please help, I'm going completely mad trying to fix this.

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    @sfstudent Try renaming those two save/load keys. I did a test where I renamed s1level to leveltest and s1nextlevel to nextleveltest and I was able to get it to save and load the correct values. I'm not sure why those two keys are corrupted, but it does seem to be the case.

    I'm going to give this back to you now (see attachment below). It is working for me, but I can't quite put my finger on what was needed. Hopefully, you can hone in on the changes. I'm pretty sure I only changed the keys for the white ("Dsiplay song") actor on the splash screen and the Tap to Add Practice Pts and Tap to Add Practice Performance Pts ("song book") actors.

    One way to avoid so many save behaviors/rules would be to have an actor that just saves attributes When Mouse Button is Down instead of multiple When Touch is Pressed rules. Another way would be to use writeable tables, but that would require restructuring things a bit.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Make sure you are not using the expression editor. That does not work when saving / loading attributes.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're asking for help without sharing the project file because your client won't allow it (which is understandable) and without sharing a screenshot of your rules. You need to give us something to work with or we can't help you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HRQPHRQP Member Posts: 26
    Ok, it is set up like this. Any time I push a button (any button), everything in "song1" saves.
    Before you go to song1, you look at a splash screen. Everything loads then. I think that is about as simple as it gets.

    http://s734.photobucket.com/albums/ww345/fg0054/?action=view&current=loadandsave.jpg
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Try wrapping the save function in a timer that runs after .1 seconds and make sure run to completion is checked. Snc eyou have touch is pressed selected, if someone taps, that might not be long enough for all rules to fire.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I also noticed you have a Destroy behavior before a Save Attribute behavior. The Destroy behavior should always go last in your list of rules. Otherwise, it can potentially prevent later behaviors from running. If you turn off the Destroy behavior, does the attribute save correctly?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HRQPHRQP Member Posts: 26
    Ok, I put a timer and nothing happened. Also, I made another actor specifically to save "song level" whenever you get into the room. I level up, leave the room, come back in, exit the game, boot it up again and my level is back to zero :/ I'd try turning off the "destroy actor" atribute but there are other actors that constantly save the same atribute that never get destroyed.

    I KNOW its saving, there are about 4 actors in the room constantly trying to save "song level" for different reasons, and I KNOW its loading because I've checked its loading atribute about 20 times by now. Yet my level still goes back to zero every time I get back into the game.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The only thing I can suggest is further troubleshooting. Is it possible you have a rule somewhere that is actually setting the value to zero? What happens if you set the value to 2 initially? Does it return to 2 again, or to zero?

    Can you isolate the problem further by creating a blank new scene and only having the level up actor and the save/load actor(s) and see if it works there?

    How are you testing saving and loading? In GS Viewer or Ad Hoc?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • LumpAppsLumpApps Member Posts: 2,881
    Do you have your load attributes at the at the start of the project? Try loading them a little later by putting them into a rule:
    self.time > 1 sec
    Load attributes.
    Sometimes when there is many things happening at start up loading fails.
    Hope this helps.
  • MotherHooseMotherHoose Member Posts: 2,456
    @sfstudent

    DestroyBehavior is before the Save in the 1st column of screenShot

    image MH
  • 3xL3xL Member Posts: 676
    edited May 2012
    personally i had some GS issues before and i think its the lua engine bugging. idk what it is honestly but i know it was gs. this was last year. its definitely improved. the memory leaked disappeared but now its back... anyways...

    with that been said, i was having a similar issue with my current app and basically i added the "load" attribute in the logo screen (first scene), AND in the title scene just to be safe. sure enough, my issues were fix. try loading the attributes on several scenes before it and see what happens...
  • HRQPHRQP Member Posts: 26
    edited May 2012
    Ok, I tried loading the attributes in the splash screen, then load them again on the home screen, then load them again on the "song select" screen and it is still not working. Actually, it messed it up even more, even less things save now :/

    I think I've tried all of your advice and nothing has worked yet. Is it difficult for GS to save and load multiple atributes?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I have a game where I load over 300 attributes in my main menu, and I'm saving a number of them throughout the game.

    the save load system is pretty bullet proof, i think you have way over complicated things.
  • HRQPHRQP Member Posts: 26
    Well it was simple at first. On release-save, and it would load on the splash screen. That was it.

    I've been fighting and wrestling GS to save/load my stuff without success for about a week now. If anyone out there likes solving problems, I'm leaving my project file below for you to test your skills. I'd be very grateful if anyone could point out where I'm going wrong and hope I'm just making a really stupid little mistake.


    Here is what you need to know:

    *loading occurs on the very first room, the "splash screen" look to the upper left for a white box "song1" is the one I've been trying to save/load properly.

    *Saving attributes can be found on the progress bar of song1, and on the "tap to add practice/perform pts" buttons.

    *the most frustrating atributes that absolutely refuse to load or save are "song1level" and "song1nextlevel"

    https://www.box.com/s/3f2d2822881f3f883dcf
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2012
    looking at it now

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HRQPHRQP Member Posts: 26
    Awesome! Thank you so much for this. I think I'm gonna start using tables for the other song slots. I can't imagine why GS would decide that "s1level" just wasn't gonna cut it but I'm glad you found what was wrong :)
Sign In or Register to comment.