Computer Science Canada Creating save games |
Author: | 7h3Q [ Thu May 05, 2005 4:31 pm ] |
Post subject: | Creating save games |
i'm wondering if its possible to create a save/load menu in turing, for a game, that would export all the variables and their values, and later recall them upon the users request. if this is possible can anyone make a tutorial on this?? would really appreciate it. i did search the turing forums, but kinda got lazy after clicking about five pages of links to posts. the tutorials i read delt with importing and exporting text, which isnt what i wish to do |
Author: | Paul [ Thu May 05, 2005 6:47 pm ] | ||
Post subject: | Re: Creating save games | ||
7h3Q wrote: that would export all the variables and their values, and later recall them upon the users request.
the tutorials i read delt with importing and exporting text, which isnt what i wish to do Wouldn't exporting the variable values into a text file work? if you designed a correct input/output system for it. Like if you wanted to save a um... tic tac toe game, where x's are marked with x's and o's are marked with o's and blanks are marked with b, then you would export a text file based on the x and o positions that looks like:
or something like that when you load this, just load the X's and O's onto the board using the values on the text file? |
Author: | 7h3Q [ Thu May 05, 2005 7:13 pm ] |
Post subject: | thanks |
havent thought of that, will have to play with those tutorials a little more to see what i can figure out. i'm pretty sure i'll be posting here with more questions as i play around with the code |
Author: | syntax0r [ Thu May 05, 2005 7:20 pm ] |
Post subject: | |
There are many SAVE/LOAD tutorials on this site, which one is the best for 7h3Q's problem, as I have the same problem? |
Author: | jamonathin [ Thu May 05, 2005 7:36 pm ] |
Post subject: | |
Read through this topic, and configure it to your own likings. http://www.compsci.ca/v2/viewtopic.php?t=7499 |
Author: | Token [ Thu May 05, 2005 7:40 pm ] | ||
Post subject: | |||
i'd have to agree with paul on that, with the games that i've made i always just save a picture of the screen to file, and take all the variables neccisary and output them to a text file, i then later recall all of them and do somthing like this
|
Author: | syntax0r [ Thu May 05, 2005 9:37 pm ] | ||||
Post subject: | |||||
Forgive my : lazyness, stupidness or ignorance, but I find those tutorials to be vague. Like I said, I'm not trying to be rude! Don't get the wrong impression, I'm just puzzled with what's happening with all these unknown syntaxs. Could someone demonstrate how I could save this variable
into whatever needed file, so that program will load the value user specified value (w/e the user types is stored in the var pleaseSaveMe ) again, outputting w/e was said upon selecting the load option EDIT: Found something that answers my question. Had to scan, but it was worth it. Still I don't know what the program does, I just intepreted it the best i could
got it from http://www.compsci.ca/v2/viewtopic.php?t=502 |
Author: | 7h3Q [ Thu May 05, 2005 11:46 pm ] |
Post subject: | kool |
thanks for the help guys, i've been toggling between turing and cs for the past "few" hours. finally got the save/load script working somewhat, still not exactly what i want it to be, but i'm getting their... i hope. really appreciate the help |
Author: | jamonathin [ Fri May 06, 2005 12:11 pm ] | ||
Post subject: | |||
Ill tell you line by line what everthing is, in lamin terms.
I hope this helps. |
Author: | 7h3Q [ Fri May 06, 2005 2:52 pm ] |
Post subject: | excellent |
excellent, thanks for the line by line explanation. my main problem was that i was not understanding the code, so i wasnt sure what to do exactly. i find it easy (as we all should) to copy something, say it works, but not comprehend one line of it. thanks again, now i comprehend all the variables and what the purpose they server the help is truly appreciated |
Author: | MysticVegeta [ Tue May 10, 2005 6:59 am ] |
Post subject: | |
oo I think that you can open the saved game files with any text editor and it to the last level without trying. o_O Even with a different extension, you can stil use notepad to open it |
Author: | Token [ Tue May 10, 2005 4:58 pm ] |
Post subject: | |
well you could use some sort of simple enctyption, you take the ascii value of the charecter, preform some math on it, and then add it to the file, and when u read the file you reverse the math function and convert it back to a string |