Need help with save"txt
Root / Programming Questions / [.]
ArrowCreated:
As Lumage said, no-one wants to write your code for you. And, you made it difficult to help you. Among other things, you were given code that did not have this problem, no-one told you that your changes - changes that you told no-one - would be a problem because no-one is a mind-reader.
To be fair, later in that post:Thanks it worked why didn't somebody tell me before nowPut this code near the beginning:Just wanted to point this outVAR SAVE[5]It will make an array (essentially a bunch of variables put into one) that will store your save data.
LOAD "DAT:SAVEDATA",SAVEDATA,012Me21 had it right, and in the other thread MZ592 and Minxrod both gave examples with proper declarations.
If the variable STATS is not declared, that's a problem. At or near the beginning of your code (but after CLEAR, if you use it), include┈┈┈┈┈┈▕▔╲ ┈┈┈┈┈┈┈▏▕ ┈┈┈┈┈┈┈▏▕▂▂▂ ▂▂▂▂▂▂╱┈▕▂▂▂▏ ▉▉▉▉▉┈┈┈▕▂▂▂▏ ▉▉▉▉▉┈┈┈▕▂▂▂▏ ▔▔▔▔▔▔╲▂▕▂▂▂IDIM STATS[9](or 5 or whatever the proper number is).
for saving numbers, I strongly reccommend that you use DAT filesOld thread bump, but I do have a relevant question. Will this save the 'real numbers' with decimal points? I have numbers with 0.01 and stuff in my variables (?) for the cost of sand/how much it pays out, etc. And I was wondering if this method of saving will allow me to save Wonky numbers with decimal points. Also, is there a limit to how many things you can save? I have a feeling some of my numbers may end up extremely large as this clicker game progressesVAR SAVEARRAY[5] ... SAVEARRAY[0]=ATK SAVEARRAY[1]=DEF SAVEARRAY[2]=GOLD SAVEARRAY[3]=HP SAVEARRAY[4]=SP SAVE "DAT:SAVEFILE",SAVEARRAYand thenLOAD "DAT:SAVEFILE",SAVEARRAY ATK=SAVEARRAY[0]etc. to load
I have a code using DAT files and its pretty good code it worked great for months but in one of the games I'm making with it it keeps changing variables on me when it's not supposed to and seems to be happening when it loads and I can't find anything in the should make it do that overall it works great with my first game I was making no problems at all