プレイ日記
Alex Foursquare5
A quick question: how do I save a numerical value, like a save file within a game for something like a checkpoint?
0そうだね
プレイ済み
返信[1]
親投稿
Snookems apples2254
save” what your saving
0そうだね
プレイ済み
返信[2]
親投稿
Alex Foursquare5
I am using the numbers to determine the level the player is in my game and the items the player may have.
0そうだね
プレイ済み
返信[3]
親投稿
Snookems apples2254
ok
0そうだね
プレイ済み
返信[4]
親投稿
Alex Foursquare5
Why can't I save the number in the screenshot? When I try, it says "type mismatch"
0そうだね
プレイ済み
返信[5]
親投稿
Snookems apples2254
try looking in the manual
0そうだね
プレイ済み
返信[6]
親投稿
Aiden crayzeefun3
I'm womdering the same thing.
0そうだね
プレイ済み
返信[7]
親投稿
Alex Foursquare5
I figured it out! But I can only save text files. I think the other way is used to save stuff like sprites. Thanks for trying to help though!
0そうだね
プレイ済み
返信[8]
親投稿
Snookems apples2254
your welcome
0そうだね
プレイ済み
返信[9]
親投稿
Oscar PwnageBlock
Copied from another comment of mine... 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そうだね
プレイ済み
返信[10]
親投稿
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そうだね
プレイ済み
返信[11]
親投稿
Oscar PwnageBlock
Feel free to ask if you need more help!
0そうだね
プレイ済み
返信[12]
親投稿
Dabe 007_Man
You could convert your #s to a string with the STR$() function, save them as a text file, and when loading convert it to a # with the VAL() function.
0そうだね
プレイ済み
返信[13]
親投稿
Alex Foursquare5
Thanks guys! I think I understand now!
0そうだね
プレイ済み