トピック
Clayton DarkClay88

Saving

How would I be able to save my variables and load them back up? Sort of like a save feature?
10そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
You can use the SAVE command in conjunction with an array. First, you'd define the array, which must be numerical and will hold the data you want to save. Afterwards, you can use the save command by specifying the file type as DAT and specifying the array. E.g.: DIM SAVARR[3] SAVARR[0]=HP SAVARR[1]=XP SAVARR[2]=IDK SAVE "DAT:FILENAME",SAVARR
0そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
Similarly, to load the data back, you'd use another numerical array and the LOAD command. You can keep the array empty as it will be expanded automatically. All data will be in the same order as you saved it. I suggest wrapping the load in a CHKFILE conditional. IF CHKFILE("DAT:FILENAME") THEN DIM LOADARR[0] LOAD "DAT:FILENAME",LOADARR,FALSE HP=LOADARR[0] XP=LOADARR[1] IDK=LOADARR[2] ENDIF
0そうだね
プレイ済み
返信[3]
親投稿
Clayton DarkClay88
Oooh. I get it. So when I save, the array (or variables) will be in a different file? And when I load, it loads it?
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
Yep! It's simple, and allows for different files to contain different data!
1そうだね
プレイ済み
返信[5]
親投稿
Clayton DarkClay88
Ok, I'm understanding arrays a bit more now. Thanks! :D You're a great help!
1そうだね
プレイ済み