Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board
Go4Expert
Go4Expert RSS Feed

Go Back   Programming and SEO Forum >  Go4Expert > Queries and Discussion > Programming > C-C++

Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More
 
Bookmarks Thread Tools Search this Thread Display Modes
Old 12-20-2008, 11:50 AM   #1
Skilled contributor
 
cpulocksmith's Avatar
 
Join Date: Jul 2008
Location: canada
Posts: 275
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 3
cpulocksmith will become famous soon enough
Send a message via MSN to cpulocksmith

how to save...


ok well, i have a question. as some of you may know i am trying to make a dungeon like text based game in c++. and so far it is going along quite will, with help from the fine people at this site. but i have one question that i think is going to be a pain. how would i save a game. i really have no idea how to save a game so that you could come back to it latter and you would be at the same position and have the same stats and items. since i realy have no idea and i have search the internet for the answer and fail i now turn to you people to point me in the correct direction. and i feel that i am not going to like the next little peace of code i am going to have to write with this new info i hope you can provide me.

thanks locksmith...
__________________
you can not defend yourself against an unfamiliar weapon
cpulocksmith is offline   Reply With Quote
Old 12-20-2008, 01:48 PM   #2
Invasive contributor
 
neo_vi's Avatar
 
Join Date: Feb 2008
Posts: 703
Thanks: 0
Thanked 13 Times in 8 Posts
Rep Power: 3
neo_vi will become famous soon enough

Re: how to save...


neo_vi is offline   Reply With Quote
Old 12-21-2008, 12:36 AM   #3
Skilled contributor
 
cpulocksmith's Avatar
 
Join Date: Jul 2008
Location: canada
Posts: 275
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 3
cpulocksmith will become famous soon enough
Send a message via MSN to cpulocksmith

Re: how to save...


well i went through both of those links you gave and i did find some stuff useful but i still really dont know what it is i am supposed to do. if it helps any i am using a unix and not windows.
__________________
you can not defend yourself against an unfamiliar weapon
cpulocksmith is offline   Reply With Quote
Old 12-21-2008, 07:09 AM   #4
Mentor
 
Join Date: Aug 2004
Posts: 2,136
Thanks: 3
Thanked 77 Times in 67 Posts
Rep Power: 13
xpi0t0s is just really nicexpi0t0s is just really nicexpi0t0s is just really nicexpi0t0s is just really nicexpi0t0s is just really nice

Re: how to save...


Just write whatever information you feel is necessary to a file, and include in the program the logic to read that file and restart the player from a specific point in the game rather than at the beginning.

Tip: Write it out in text format first, then it's easy to read and to edit. Binary files can be a pain but once you've got it sorted you can switch to a binary format if you like.
Tip 2: sort out the file read logic first, using hand-crafted savegame files. Once you know what you need in the file you can then write the file write logic.
xpi0t0s is offline   Reply With Quote
Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Bookmarks

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 Off
Pingbacks are Off
Refbacks are Off

 

All times are GMT +5.5. The time now is 04:11 PM.