トピック
受付中
Dobs Dobs60

help with game progress save

can anyone help? how would i implement an in-progress game save in my game. i am looking to be able to be able to save and restart at the same map location and retain all progress (items, experience, weapons, scrolls, etc.). if i am not wrong backup would not do that.
3そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
You need to create a DAT file that will contain all these variables. It's a straightforward process. 1. Declare an array that will fit all the stuff you will save. 2. Fill this array with said stuff. The order is not important, but you must remember it. 3. Call the SAVE instruction. Specify DAT file type and the array to save.
1そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
DIM SAVARR[3] 'Let's assume I have 3 variables to save SAVARR[0]=HP SAVARR[1]=MP SAVARR[2]=EXP SAVE "DAT:FILE1",SAVARR Note: If you want to save an array... If it's a static array (fixed length), you can just accommodate it in the same save array. If you have a dynamic array, you'll want to create a separate file for it, although there is a semi-complicated workaround.
1そうだね
プレイ済み
返信[3]
親投稿
Oscar PwnageBlock
Strings follow a different saving process and use a separate file, but the process is similar. Let me know if you want an explanation for it. Loading the data back up is also a similar process. It's pretty much the same as saving, but backwards. Let me know if you want an explanation for it as well.
1そうだね
プレイ済み
返信[4]
親投稿
PChicken NerdChicken
If you want to put mixed value types in a prg file (it's really easy) then do this saving: PRGEDIT 1,1 PRGDEL 1,-1 FOR I=0 TO LEN(ARRAY[]) PRGEDIT 1, I+1 PRGSET STR$(ARRAY[I]) NEXT FOR I=LEN(ARRAY[]) TO LEN(ARRAY[])+LEN(ARRAY$[]) PRGEDIT 1, I+1 PRGSET ARRAY$[I-LEN(ARRAY[])] NEXT SAVE "PRG1:SAVE"
0そうだね
プレイ済み
返信[5]
親投稿
PChicken NerdChicken
oops, some of the stuff is wrong, but it should work with some easy fixing
0そうだね
プレイ済み
返信[6]
親投稿
Dobs Dobs60
thank you all for your help. it is greatly appreciated. my knowledge of 'basic programing' is limmited. and finding reference material for basic is hard. i cant even find 'basic for dummies' book. so thanks guys.
1そうだね
プレイ済み
返信[7]
親投稿
Dobs Dobs60
i got smile basic because when i was in my teens i got a 'comadore 64' and tried to do some basic but then life happened. i look at programing in sb as a game itself. to me itis one big logic problem to be figured out. trial and error is my most used approach but never shy away from help. so thanks to all again.
1そうだね
プレイ済み