Hello forum members,
Ok so my problem is that I can't figure out how to save my stack in another file which can then be opened from within the stack again. Currently I am studying computing at school and must complete a project with several "complex" functions so as to get a good grade. I have made a text based game and one of the complex functions I thought would be good was the ability to save the progress made in the game. Unfortunately I can't quite find a way of saving anything other than text to another file. I tried the "save" command but that literally saves the stack which I guesses would be the case. So my question is, is it possible to save the content of everything in a stack to file in a way that it can be opened again like other games offer? The idea being that I need to save the contents of certain variables that have changed due to the players actions such as picking up items etc. Any help is much appreciated. Thank you!
Saving the contents of a stack in another file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Saving the contents of a stack in another file
Hi,
If you want to save the coordinates of buttons, the contents of images etc., you might as well save the stack itself in a writable place. Just make a splash stack that either opens the stack or creates a new one:
Kind regards,
Mark
If you want to save the coordinates of buttons, the contents of images etc., you might as well save the stack itself in a writable place. Just make a splash stack that either opens the stack or creates a new one:
Code: Select all
put specialfolderpath("documents") & "/app name/stackwithcontents.rev" into myPath
if there is a stack myPath then
go stack myPath in new window
else
clone stack "your substack" // this stack is now open
save it as myPath
end if
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Saving the contents of a stack in another file
Ok Mark, I will give this a shot tomorrow as that is when I have my next lesson, thank you very much