Go to Post That's wicked sweet (and I'm not even from New England). - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-11-2003, 22:03
Tton Tton is offline
Registered User
#1089 (Team Mercury)
 
Join Date: Jan 2003
Location: Hightstown, NJ
Posts: 84
Tton is on a distinguished road
Send a message via AIM to Tton Send a message via Yahoo to Tton
Need help with C++

How do you save your variables in a file in C++. Im talking it this year and me and a friend are doing a side project and we want the ability to save... We only need variables saved not anything else.

Thanks!

Also if you can help me understand how you can run an image thing in C++ like a max picture that would help to
__________________
T-ton
  #2   Spotlight this post!  
Unread 03-11-2003, 22:13
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Well, there's no way to just do something like
saveAllVariables()
loadAllVariables()

but you can just write them all out to a file one by one:

ofstream ofs;
ofs.open("out.txt", ios:ut);
if(!ofs){
//error stuff goes here
}

ofs << var1 << ' ' << var2 << ' ' << var3 << etc, etc;

ofs.close();

and then to read it back in:

ifstream ifs("out.txt");
if(!ifs)
//error stuff

ifs >> var1 >> var2 >> var3 >> etc,etc;



Let me know if you need anything else.

-Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 04-11-2003, 11:02
AntmanIV AntmanIV is offline
Registered User
#1089 (Team Mercury)
 
Join Date: Feb 2003
Location: Hightstown, NJ
Posts: 15
AntmanIV is an unknown quantity at this point
Send a message via AIM to AntmanIV
yes but rob, t-ton and I would like to know how to run 3d images and manipulate things in 3d like you can do in 3ds max. we are making an rpg.

Also what header files are needed to compile the above code?
__________________
Saru mo ki kara ochiru. --
Even monkeys fall from trees. or
Anyone can make a mistake.

What do bananas smell like?
  #4   Spotlight this post!  
Unread 04-11-2003, 14:03
mtrawls's Avatar
Happy Birthday! mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Quote:
yes but rob, t-ton and I would like to know how to run 3d images and manipulate things in 3d like you can do in 3ds max. we are making an rpg.
Well, if you want to manipulate an image, it depends what type of image file it is, ie., what format it is. To take a more general approach to things, and since you say it is for a game, might I suggest looking at OpenGL or CrystalSpace or any of a variety of graphics engines.

Quote:
Also what header files are needed to compile the above code?
All it uses is streams, so it would probably be a good bet that you'd need iosream.h.
  #5   Spotlight this post!  
Unread 04-11-2003, 18:07
AntmanIV AntmanIV is offline
Registered User
#1089 (Team Mercury)
 
Join Date: Feb 2003
Location: Hightstown, NJ
Posts: 15
AntmanIV is an unknown quantity at this point
Send a message via AIM to AntmanIV
also is there any way to change the color of text in a dos window? We will look into openGL, have you uesd it before? if so any tips?
__________________
Saru mo ki kara ochiru. --
Even monkeys fall from trees. or
Anyone can make a mistake.

What do bananas smell like?
  #6   Spotlight this post!  
Unread 04-11-2003, 18:13
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
To use the above code you need iostream.h and fstream.h you may also needs stdlib.h, depending on what your compiler includes automatically, etc.

As for image stuff, C++ won't do it by itself, so you're going to need some kind of library. If you could give some more specifics as to what you're trying to do, I'd be more than happy to point you in the right direction. For starters, given that you seem to be creating a game, check out gamedev.net. They've got some really good tutorials/howtos, and their discussion boards are incredibly helpful.

-Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #7   Spotlight this post!  
Unread 04-11-2003, 18:25
AntmanIV AntmanIV is offline
Registered User
#1089 (Team Mercury)
 
Join Date: Feb 2003
Location: Hightstown, NJ
Posts: 15
AntmanIV is an unknown quantity at this point
Send a message via AIM to AntmanIV
yea we are working on an rpg. T-ton and I want to use 3ds max and make the code let you run around and do stuff like in any other rpg like asheron's call or Star wars Galaxies and such.

but untill we can do that we were wondering if there is any way to use ... conio.h? ... or something to change the color of text like they do on some muds like achaea?
__________________
Saru mo ki kara ochiru. --
Even monkeys fall from trees. or
Anyone can make a mistake.

What do bananas smell like?
  #8   Spotlight this post!  
Unread 04-11-2003, 19:15
mtrawls's Avatar
Happy Birthday! mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Well your question isn't one that can elicit a simple response. Unfortunately. Game programming is a tricky matter, and can get confusing if you don't know what you are doing -- or if you do!

How do you change text color? Well, you first have to decide if you want your game to work in one specific venue (such as MS), or if you want cross-platform support. You'll need to get some libraries to work with -- DirectX for Windows, and various others for varying platforms (the CrystalSpace link I posted before is a multi platform game engine with blosoming support for 3ds max ... I have some experience with this, and can offer some advice if needed). From there, look into the API of the specific library you have. There are a variety of books detailing DirectX API structure, and game programming in general.

As for 3ds max support, it all depends on the library you have. It will need to have functions to read in a 3ds file -- or you'll need to get a converter to change your 3ds file to another format (such as a quake file format), and the conversion might not be absolutely perfect (computers are funny like that).

In doing a quick search on google, I came across this:

Quote:
When I talk to people looking to get into game development some of the first things I often hear fall along the lines of, "How do I make games?" or "I want to make a game like Quake/Everquest/Starcraft and…". The first is just way out of the realm of answerability, as there are too many aspects to possibly go into, and each of those components can be infinitely complex.

The second, however, falls into just being unrealistic in expectations. Starcraft, Everquest and Quake were all made by teams of professionals who had budgets usually million dollar plus. More importantly though, all of these games were made by people with a lot of experience at making games. They did not just decide to make games and turned out mega-hit games, they started out small and worked their way up. This is the point that anyone who is interested in getting into game development needs to understand and repeat, repeat, repeat until it becomes such a part of your mindset that you couldn’t possibly understand life without this self evident, universal truth.

Until you understand that all skills in game development are learned by experience, (meaning to start very small and working your way up) you will be absolutely doomed to never finish your projects. Even the infinitesimal number of teams that do manage to finish a non-trivial project before they have made any smaller ones have to learn incrementally, it just takes them many times longer than if they had started out with smaller projects.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi