? Please Help Me with saving!!! (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
What's going on?? See: Site Update March 2022

Please Help Me with saving!!!

1 2
  • #1 ✎ 14 Codezero13 I have @ save DIM Variables[9] variables[1]=item variables[2=item variables[3]=item variables[5 ]=item variables[5]=item so on.. save "dat:rpgsave",variables goto @save @load load "dat:rpgsave",false out variables got load but it's saying I have a duplicate variable... and just.... please help. Posted
  • #2 ✎ 14 Codezero13 i meant to put item1 item2 item3 item4 item5 Posted
  • #3 ✎ 14 Codezero13 If anyone will help it would be greatly appreciated... Posted
  • #4 ✎ 14 Codezero13 .... Posted
  • #5 ✎ 14 Codezero13 I give up. Posted
  • #6 ✎ 477 SquareFingers This is not live real-time tech support you pay for, this is a forum of people who volunteer answers. Impatience is rude. And, it doesn't say you have a duplicate variable, if that's your code. It says syntax error. Posted
  • #7 ✎ 14 Codezero13 N-now it's saying illegal function... will you please help?.... Posted
  • #8 ✎ 477 SquareFingers You're the only one who can make it possible for people to help you, by giving all the relevant information, and giving it accurately. You're also the only one who can make it so people want to help you - you don't need to overplay how c-close you are to c-crying. Posted
  • #9 ✎ 272 TheV360 Pokemon Is Awesome! I love Pokemon! Express Yourself First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Search your code for DIM VARIABLES[9] 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: VAR SAVE[5] It 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[0]=ATK SAVE[1]=DEF SAVE[2]=GOLD SAVE[3]=HP SAVE[4]=SP SAVE "DAT:SAVEDATA",SAVEDATA The first 5 lines put your variables into the array, and the final line saves the array as a DAT file. Arrays start with 0 for some reason... If you have an array with 5 things in it, the array will go from 0-4. Odd. When you want to load, use this: LOAD "DAT:SAVEDATA",SAVEDATA,0 ATK=SAVE[0] DEF=SAVE[1] GOLD=SAVE[2] HP=SAVE[3] SP=SAVE[4] If 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)
    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.
    Posted
  • #10 ✎ 14 Codezero13 @TheV360 thank you! I will give it a try ^_^ Posted
  • #11 ✎ 14 Codezero13 Also i'm sorry if I came off rude. I just was working on it for a while and nothing was working. that's no excuse for being that impatient though. Posted
  • #12 ✎ 341 Minxrod Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength QSP Contest 2 Contest Participant I participated in the second SmileBASIC Source QSP Contest!
    and nothing was working
    Yeah, that pretty much happens all the time >:D Also, if the saving/loading isn't working, try to add the integer suffix to the array, I think it might've had loading problems if it loads in the wrong format.
    Posted
  • #13 ✎ 202 JustGreat First Month Joined in the very first month of SmileBASIC Source Website Avatar Taboo I didn't change my avatar for 180 days Website Night Person I like the quiet night and sleep late. Express Yourself For the future, if you're searching for instant answers, then the site chat is your best bet. The best way to find answers is definitely the forums, however. Posted
  • #14 ✎ 14 Codezero13 ok so now I have var=10 save[0]=shovel save[1]=item1 save[2]=item2 save[3]=item3 save[4]=item4 save[5]=money save "dat:savedata",savedata and it says type mismatch in 0:78(save:2) Posted Edited by Codezero13
  • #15 ✎ 341 Minxrod Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength QSP Contest 2 Contest Participant I participated in the second SmileBASIC Source QSP Contest!
    ok so now I have var=10 save[0]=shovel save[1]=item1 save[2]=item2 save[3]=item3 save[4]=item4 save[5]=money save ''dat:savedata'',savedata and it says type mismatch in o:78(save:2)
    Type 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. SmileBASIC doesn't like to won't save files with lowercase.
    Posted Edited by Minxrod
  • #16 ✎ 14 Codezero13 Thanks for helping me, but it's still giving me the type mismatch... is there any other way I could save all my data at once? Posted
  • #17 ✎ 63 blizord There are like three topics for this. Posted
  • #18 ✎ 14 Codezero13 ??? Posted
  • #19 ✎ 1093 Yolkai Head Admin is it the part where you're using double parens instead of a " Posted
  • #20 ✎ 14 Codezero13 Unfortunately no... I use the " " when i'm programming... I have heard of saving with str$ and txt could someone explain how to do that :) Posted
1 2