for the text file if it hasnt been answerd
-this is taken from my game-
i have a folder called Data inside that is another folder called War Arena and then Campaign, and inside that is Default Campauign, and the file is called names.txt
this file gets names.
every read string is 1 line
so you cant mis out lines so what i do is i tell it that that line is Nothing$ and Nothing$ isnt used
i then put read sting and when i get to the line i want
(say 6 lines in that means theres 5 nothings$ before)
when i get to this line i can call the string what i want
EG:
enemy1$
then at the bottem i can change this into other types where i write
Enemy1 = Val(Enemy1$)
that means enemy1 is the enemy1$ found in the text file.
open to read 8, "DATA/War Arena/Campaign/Default Campaign/names.txt"
Read string 8, Nothing$
Read string 8, Nothing$
Read string 8, Nothing$
Read String 8, Enemy1$
Read string 8, Enemy2$
Read string 8, Enemy3$
Read string 8, Enemy4$
Read string 8, Enemy5$
Read string 8, Enemy6$
Read string 8, Enemy7$
Read string 8, Enemy8$
Read string 8, Enemy9$
Read string 8, Enemy10$
Read string 8, Enemy11$
Read string 8, Enemy12$
Read string 8, Enemy13$
Read string 8, Enemy14$
Read string 8, Enemy15$
Read string 8, Nothing$
Read string 8, Nothing$
Read String 8, Train1$
Read String 8, Train2$
Read String 8, Train3$
Read String 8, Train4$
close file 8
Enemy1 = Val(Enemy1$)
Enemy2 = Val(Enemy2$)
Enemy3 = Val(Enemy3$)
Enemy4 = Val(Enemy4$)
Enemy5 = Val(Enemy5$)
Enemy6 = Val(Enemy6$)
Enemy7 = Val(Enemy7$)
Enemy8 = Val(Enemy8$)
Enemy9 = Val(Enemy9$)
Enemy10 = Val(Enemy10$)
Enemy11 = Val(Enemy11$)
Enemy12 = Val(Enemy12$)
Enemy13 = Val(Enemy13$)
Enemy14 = Val(Enemy14$)
Enemy15 = Val(Enemy15$)
Train1 = Val(Train1$)
Train2 = Val(Train2$)
Train3 = Val(Train3$)
Train4 = Val(Train4$)
now that is loading and getting the info
saving is very simalar
this is also taken from my game and also covers deleting files:
the first few lines will check if this file exists and if it does it will delete it.
the next load of lines will save strings
so like loading i find the path i want to save it to.
Quote: "Open To Write 2, "Data/Version Data and Information/VersionData.txt""
i then do 'write string' and then the file name
and then using speach marks as if you were writing with the Print command
you write what you want to say
if you want to put it on a new line then you do another write string below
at the end you have to put close file
if file exist ("Data/Version Data and Information/VersionData.txt")
delete file "Data/Version Data and Information/VersionData.txt"
endif
Open To Write 2, "Data/Version Data and Information/VersionData.txt"
write string 2,"War Arena is a game deveolped from the Outscape Production Team"
write string 2,"It is brought to you by Headchopperz who is the co-founder of Outscape."
write string 2,"Up to the point of this patch was created Headchopperz is the sole coder for this game"
write string 2,"This game has used the language of Dark Basic and used the Dark Basic compiler to create the .exe file"
write string 2,""
write string 2,"Your Version of War Arena is 2.6"
write string 2,""
write string 2,""
write string 2,"Details of Version 2.6:"
write string 2,"1.)Fixed image bug!"
write string 2,"2.)Fixed music bug!"
write string 2,"3.)Added Leaderboard!"
write string 2,"4.)Game finishable!"
write string 2,"5.)Added more AI!"
write string 2,"6.)Added Bosses!"
write string 2,"7.)Added nicer media!"
write string 2,""
write string 2,""
write string 2,""
write string 2,"War Arena is an Outscape Production which has been brought to you by Headchopperz."
write string 2,"If you have any questions or comments please mail us at outscapeteam@yahoo.co.uk."
write string 2,"If you want a fast reply add me on your yahoo/msn messanger."
Close File 2
Creators of Outscape
http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8