Saving in game directory

Non-platform specific questions.

Saving in game directory

Postby tom.drin » Mon Aug 01, 2005 7:45 am

Hi,
I've got small problem. I have configuration file and I want it in game directory. But when I do this:
....
config=fopen("pdm.cfg","w");
.....
The pdm.cfg appears in root directory.

I know it's stupid question, but can somebody help me?
tom.drin
 
Posts: 13
Joined: Fri May 06, 2005 10:08 pm
Score: 0 Give a positive score

Postby BeyondtheTech » Mon Aug 01, 2005 12:51 pm

This might be as silly a question, but what data are you saving that you couldn't use the loadVars/saveVars command with?

I found this to be a key feature in Game Editor Pro, as you can break up your game in modules and "pass" variables between them, such as score, lives, level, etc. Plus, you can make different groups of variables to be saved in different save files.

And it's so much simpler than having to write out code to load and save your configuration file. Just assign the variables to groups, then use the saveVars command to save the data of the group of variables to a file.

Your hardest part, if anything, will be to make sure you synchronize the variable names, its data type, and the group names between all the files that will be using the saved data.

Did I mention that the filename you specify automatically gets saved in the same folder as the game executable/modules? :wink:

For more information, visit http://www.game-editor.com/forum/viewto ... t=loadvars
User avatar
BeyondtheTech
 
Posts: 270
Joined: Wed Mar 30, 2005 6:34 am
Location: Edison, NJ
Score: 4 Give a positive score

Re: Saving in game directory

Postby makslane » Tue Aug 02, 2005 2:22 pm

tom.drin wrote:when I do this:
....
config=fopen("pdm.cfg","w");
.....
The pdm.cfg appears in root directory


Bug! Will be solved in next version
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby tom.drin » Tue Aug 02, 2005 7:40 pm

Hi, thanks for your replies.
Thats great you will solve it in next version.


About loadVars/saveVars: I didn't know about these functions. Unfortunately my game is so complicated and build up with classic file system, that I don't want to invest time to rebuild it.

So, I will be looking for next version.
tom.drin
 
Posts: 13
Joined: Fri May 06, 2005 10:08 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest