Help with saving a game

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
crazydrivr
Newbie
Posts: 8
Joined: Sat May 06, 2006 8:32 pm

Help with saving a game

Post by crazydrivr »

I need help with making a save system for a game. Can anyone help?
Dr_D
Veteran
Posts: 58
Joined: Fri Jun 17, 2005 4:47 pm
Contact:

Post by Dr_D »

What kind of game is it? Are you using user defined data types? It's pretty easy to do what you want if you are... a pain in the butt if you're not. You'll have to post some code or a link to the program. ;)
The Dr. is INsane!!!
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

Look up the syntax for the WRITE and INPUT # commands. They are ideal for a save game (unless it really matters if some variables can be changed. WRITE saves files in plain text, making them easy to change.)
crazydrivr
Newbie
Posts: 8
Joined: Sat May 06, 2006 8:32 pm

Post by crazydrivr »

I am making an RPG, so it needs to save variables and still allow them to change and also save what sub you are on. Is that possible on qbasic?
User avatar
Theophage
Coder
Posts: 44
Joined: Sun May 07, 2006 7:32 pm
Location: Tucson, AZ
Contact:

Post by Theophage »

Like Patz said, you need to learn how to open a file, write to it, and input from it. Look up OPEN, WRITE, and INPUT in the Qbasic help.
Daniel "Theophage" Clark
theophage (at) geocities (dot) com

"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
User avatar
Theophage
Coder
Posts: 44
Joined: Sun May 07, 2006 7:32 pm
Location: Tucson, AZ
Contact:

Post by Theophage »

I just happened to have run across a some tutorials explaining how to work with files: http://fbtk.net/phpBB2/articles.php?cat=1 (you'll want either the sequential files one or the binary files one)

I hope that helps!
Daniel "Theophage" Clark
theophage (at) geocities (dot) com

"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
Post Reply