Saving Problems

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Saving Problems

Post by Danny » Wed Mar 23, 2011 4:31 am

I have a Main Menu as MainStack and a Level selection as a MainStack with about 25 substacks for levels. When I have it like all my text fields and object save perfectly on the Level Select Stack. But I ran into some complications when a user quit my app in the middle of a level because it froze all the objects and just made more and more. So I made them SubStacks under the Main Menu so the levels status didn't get saved. It worked perfect.
Then the text fields and object stopped saving. I don't know why it wouldn't save the Level Select Stack. Do you know how to stop saving a single subStack?
If you need code let me know

Thanks,

Danny

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving Problems

Post by Klaus » Wed Mar 23, 2011 12:06 pm

Hi Danny,

I am not sure I get this right...
Are we talking about a standalone app?

Please keep in mind that standalones NEVER save themselves! NEVER!

It is up to you, the developer, to save the data in a place where the app
has writing permission and read this data back into the app when it starts.

And if you have your substacks as separate files, only users with ADMIN rights
are allowed to write data (= save (sub-)stacks) in the APPLICATION folder on
the appropriate platform!

So NOT SAVING anything is what you should experience in that case and
that behaviour is correct.

OK, what did I misunderstand? :D


Best

Klaus

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Saving Problems

Post by Danny » Fri Mar 25, 2011 1:44 am

Hey Klaus,
I'm sorry my post can get a bit confusing, it's tough to explain over the internet :P

Anyway I think example programs seem to work well. First though, I do know that the developer has to make the app save itself because it took me some evenings to figure that out.

I made the first one like so...
When you open the app IN THE SIMULATOR you get the first stack and the button saves the Level Menu stack. Then you go into each level and press the big button. Next you go to the menu to see the numbers in the text fields, quit and reopen to verify that it saved. That's all you have to do for both programs.
Maybe I can explain my problem better.

How my app works is there are two cards, one Main Menu and one Level Select, and currently all the levels (25 of them) are substacks under the Main Menu just like in program 1.
The first program is the one i've been having the issues with. When I make the app with the levels (they're substacks) under the Menu, it won't save after you quit.

How it used to work is all the levels were under the Level Select and everything was saving fine. But if a player quit in the middle of a level all the apples (an element of my game) froze on the screen and became part of the background, thus adding more and more when you quit while playing. I tried using the code

Code: Select all

 Do not save stack "Level 8"
but it didn't work. Do you know of a way to stop saving the progress of a substack so it doesn't leave the apples on the screen? From my reading so far I don't think there is a way but i'm not positive.
The second program is the one that works just fine it saves and everything is working perfect.
Should I check the box where it says "Move substacks into individual stack files?"

Now as far as I can see all the settings are the same but maybe you'll notice something or maybe something in my process isn't possible. Let me know.

As always, thanks for taking the time to help,

Danny
Attachments
Saving Stacks 2.zip
Program 1
(4.42 KiB) Downloaded 295 times
Saving Stacks.zip
Program 2
(4.45 KiB) Downloaded 330 times

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving Problems

Post by Klaus » Fri Mar 25, 2011 12:48 pm

Hi Danny,

you cant stop a "saving in progress"!

And you cannot define what gets saved when you save a mainstack with substacks or a substack of a minstack.
In that case the complete file (main AND substacks) gets saved!


Best

Klaus

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Saving Problems

Post by Danny » Fri Mar 25, 2011 12:54 pm

Hi Klaus,

I kind of had a feeling that you couldn't :(. Did you notice any other problems with the program? Any idea why is not saving in program 1?

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Saving Problems

Post by Klaus » Fri Mar 25, 2011 12:57 pm

Hi Danny,

sorry, I did not look into your stacks.
But not using text files for storing info from standalones is asking for trouble! 8)


Best

Klaus

unclewayne
Posts: 37
Joined: Tue Apr 05, 2011 9:58 pm

Re: Saving Problems

Post by unclewayne » Thu Apr 07, 2011 12:38 am

Hey Danny,
I hope you get this. I have been looking for a simple answer to this (I am new to LiveCode). In your files you have:
on mouseUp
open stack "Level 4"
end mouseUp

For "button level 4".

My question is, where is the "level 4" stored? I created a simple little game from the bulls-i tutorial and i want to create a start menu and i can't figure out how to. Any info would be awesome.
Thanks

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Saving Problems

Post by Danny » Fri Apr 08, 2011 12:06 am

If you look under the standalone settings, one should be under the "Main Menu" and on the other program it should be under "Level Select"

Hope that helps. Let me know,

Danny

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Saving Problems

Post by SparkOut » Wed Apr 20, 2011 10:17 am

Klaus wrote:Hi Danny,

you cant stop a "saving in progress"!

Klaus
I must confess, having read this thread I'm not entirely sure what the desired result is, but...

It is true that you cannot stop a "saving in progress" but if you handle the "saveStackRequest" message and do not pass it, you can stop a save from taking place before it's actually begun. I'm not entirely sure whether that is useful here, sorry for being dense.

Post Reply