Page 1 of 1

Saving in game directory

PostPosted: Mon Aug 01, 2005 7:45 am
by tom.drin
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?

PostPosted: Mon Aug 01, 2005 12:51 pm
by BeyondtheTech
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

Re: Saving in game directory

PostPosted: Tue Aug 02, 2005 2:22 pm
by makslane
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

PostPosted: Tue Aug 02, 2005 7:40 pm
by tom.drin
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.