Please Help Me with saving!!!
Root / Programming Questions / [.]
@ save DIM Variables variables=item variables[2=item variables=item variables[5 ]=item variables=item so on.. save "dat:rpgsave",variables goto @save @load load "dat:rpgsave",false out variables got loadbut it's saying I have a duplicate variable... and just.... please help.
Search your code for DIM VARIABLES and see if it shows up more than once. Also, I've answered this question before, so here's a quoted part of it that I hope helps you:
Put this code near the beginning:I agree with SquareFingers' first statement, (but the rest, seriously?! also that statement about making people want to help you is ironic) you need to supply all the information so that we can help you better. One last thing: there's an edit button so you can fix the first post.VAR SAVEIt will make an array (essentially a bunch of variables put into one) that will store your save data. When you want to save, use this:SAVE=ATK SAVE=DEF SAVE=GOLD SAVE=HP SAVE=SP SAVE "DAT:SAVEDATA",SAVEDATAThe first 5 lines put your variables into the array, and the final line saves the array as a DAT file.When you want to load, use this:
Side NoteArrays start with 0 for some reason... If you have an array with 5 things in it, the array will go from 0-4. Odd.LOAD "DAT:SAVEDATA",SAVEDATA,0 ATK=SAVE DEF=SAVE GOLD=SAVE HP=SAVE SP=SAVEIf I remember correctly, this will only work with integers. You can't save real numbers as DAT files. (Integers are variables that can't have decimal points and real numbers are the ones that can)
ok so now I haveType Mismatch in 0:78 not o:78 It might be because you didn't use quotations around DAT:SAVEDATA, and DAT:SAVEDATA has to be in caps I am pretty sure. SmileBASICvar=10 save=shovel save=item1 save=item2 save=item3 save=item4 save=money save ''dat:savedata'',savedataand it says type mismatch in o:78(save:2)