Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


making and using a save game file


making and using a save game file

Author
Message
adam bailey
adam bailey
Forum God
Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)

Group: Forum Members
Posts: 27, Visits: 7

I have been learning VB for around 2 weeks now. I have been making a few simple games but i haven't been able to save them. I was wondering if someone could tell me how to make a save file, and how to wright and read from it.

The file would need to include things like Items, health, fat and muscle as well as where the image of the player is at the save point , or time of save.

(I haven't decided weather to have a save point or a save option yet.)


Joyce
Joyce
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 53, Visits: 1
There are several ways to do this. Probably the most simple is to write information to a text file, and load that information when the program is opened again.


adam bailey
adam bailey
Forum God
Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)

Group: Forum Members
Posts: 27, Visits: 7

How would i make the program read and write to the text file?


Joyce
Joyce
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 53, Visits: 1
Which version of VB are you using?
adam bailey
adam bailey
Forum God
Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)

Group: Forum Members
Posts: 27, Visits: 7
6.0
adam bailey
adam bailey
Forum God
Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)

Group: Forum Members
Posts: 27, Visits: 7

I got the below code from a forum that i don't remember the name of. (I have the worlds worst memory.)

It works great for saving and loading information from one text box, but I want it to save and load information of lots of text boxs. How would it need to be changed for it to save and load information from more than 1 text box?


Private Sub command1_Click()

Open "C:\WINDOWS\Desktop\testfile.txt" For Input As #1
text1.Text = Input(LOF(1), #1)
Close #1

End Sub

Private Sub command2_Click()

Open "C:\WINDOWS\Desktop\testfile.txt" For Output As #1
Print #1, text1.Text
Close #1

End Sub


Joyce
Joyce
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 53, Visits: 1
It's been a long time since I've done this. I've zipped two chapters worth of course work that I did three years ago. The two chapters worked with saving and retrieving data in a number of ways (not for a game, but the code for saving and retrieving data is there).

Here's my zipped file:
www.mapletreelearning.com/temp/usingfiles.zip

If you have questions about particular projects, I can become familiar with them again.
adam bailey
adam bailey
Forum God
Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)Forum God (5.8K reputation)

Group: Forum Members
Posts: 27, Visits: 7
thanx that was everything i wanted and more
Joyce
Joyce
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 53, Visits: 1
I'm glad it helped. You will notice how I played with graphic effects in those assignments, too.
dannyrose12
dannyrose12
Forum God
Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)

Group: Forum Members
Posts: 13, Visits: 5
There are several distance to do this. Probably the most elongate is to correspond collection to a book file, and burden that information when the show is unsealed again.


Remote Control Cars | HGH supplements | Dissertation Help
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search