Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Visual basic game creation
Closed Thread
Old 02-10-2005, 12:10 PM   #1 (permalink)
 
Newb Techie

Join Date: Feb 2005

Posts: 4

NoNeedForAName

Default Visual basic game creation

I'm trying to create an RPG-like game in visual basic. I'm making a separate form for your character's statistics and equipment that can be brought up at any time, and I have a few questions.

1. Saving a game. I need to know if I can save all the variables in the form to some kind of document so I can "Load Game" and bring back the same character that was saved before.

2. After switching to view the form with the characters stastics, I need to be able to switch back to the last form I was on. Is there a way I can set the frmForm.show as the last form I was on?


Sorry if these questions seem fairly stupid, I just recently learned visual basic and I think it's probably the most useful language I know so far. I'm really excited to start learning more!!

Thanks in advance!
NoNeedForAName is offline  
Old 02-11-2005, 08:27 AM   #2 (permalink)
 
Ultra Techie

Join Date: Dec 2004

Location: New Brunswick, Canada

Posts: 511

LegendBreath

Send a message via MSN to LegendBreath
Default

For the saving and loading you can use a ".INI" file (a configuration file) for nice and neat examples go to http://www.planet-source-code.com/

For the second thing use a string to hold the name of the form you was on it. And use a "If" command here is an example:

Private Sub cmdBack_Click()
If strLastFrm = "frmSomething" Then
Me.Hide
frmSomething.Show
End If
End Sub
__________________
LegendBreath is offline  
Old 02-11-2005, 12:42 PM   #3 (permalink)
 
Newb Techie

Join Date: Feb 2005

Posts: 4

NoNeedForAName

Default

Hey thanks alot! I'm reading up on creating these .INI files (i know i've used these somewhere before but I can't remember where) and hopefully I will be able to get it. As for the second part, I'm glad you brought that up because I totally missed it, it seems so easy now. I appreciate it!
NoNeedForAName is offline  
Old 02-12-2005, 10:52 AM   #4 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

You could also use something like RPG Creator 2k3. When I'm at home I'll upload it for you if you want.
Also, just pass the current form as a parameter to the second form, then you'll have it as a variable to work with.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On