Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,454 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Where does save_dir get its value ? #246432
01/15/09 07:51
01/15/09 07:51
Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Andreas C Offline OP
Senior Member
Andreas C  Offline OP
Senior Member

Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
I have some issue with some lite-C (A7.66 Pro) code, where a file_open_write command is used.

When the file does not exist, it tries to create it (as is stated in the manual) in the save_dir directory.

The problem I see is that save_dir is NULL, which causes a whole set of issues (i.e. the file handle returned from file_open_write is '0' and any subsequent attempts to write to the file cause a crash [invalid pointer] ...). I know how to work around this issue, but one thing that interests me is where / how the save_dir is intialized (I know that I could set it in a .WDL ... I want to know how the engine does it).

Cheers,
Andreas


____________________________________________________
GameCore / Unity / UDK
Lightwave 9.6 / Blender / Fragmotion / ZBrush 3.5
TextureMaker / PSP-X
Re: Where does save_dir get its value ? [Re: Andreas C] #246489
01/15/09 12:57
01/15/09 12:57
Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Andreas C Offline OP
Senior Member
Andreas C  Offline OP
Senior Member

Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Any help would be appreciated ...

Cheers,
Andreas

Last edited by Andreas C; 01/18/09 21:03.

____________________________________________________
GameCore / Unity / UDK
Lightwave 9.6 / Blender / Fragmotion / ZBrush 3.5
TextureMaker / PSP-X
Re: Where does save_dir get its value ? [Re: Andreas C] #247071
01/18/09 21:03
01/18/09 21:03
Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Andreas C Offline OP
Senior Member
Andreas C  Offline OP
Senior Member

Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...

Bump ...


____________________________________________________
GameCore / Unity / UDK
Lightwave 9.6 / Blender / Fragmotion / ZBrush 3.5
TextureMaker / PSP-X
Re: Where does save_dir get its value ? [Re: Andreas C] #247082
01/18/09 22:07
01/18/09 22:07
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
manual:

Quote:

The folder for saving files, game scores, and screenshots. By default, it's the work folder; it can be set to another folder with the -dir command line option or the SAVEDIR statement in a WDL file.


Re: Where does save_dir get its value ? [Re: TechMuc] #247138
01/19/09 08:20
01/19/09 08:20
Joined: Jan 2009
Posts: 36
Philippines
U
unknown_master Offline
Newbie
unknown_master  Offline
Newbie
U

Joined: Jan 2009
Posts: 36
Philippines
whoaaa...i dont know how to save game files...i cannot help you this time...but i try it to give you the code on how to save a game...





From: Philippine Game Developers.

Re: Where does save_dir get its value ? [Re: TechMuc] #247152
01/19/09 08:40
01/19/09 08:40
Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Andreas C Offline OP
Senior Member
Andreas C  Offline OP
Senior Member

Joined: Sep 2001
Posts: 375
Hamburg, Germany / Springfield...
Originally Posted By: TechMuc
manual:
Quote:

The folder for saving files, game scores, and screenshots. By default, it's the work folder; it can be set to another folder with the -dir command line option or the SAVEDIR statement in a WDL file.



Yup ... I read that, but the point is that the save_dir is not set to point to the work directory ... it's an empty (NULL?) string when I show it (via printf()) ...

I know that the "-dir" option is supposed to set it (as well as the SAVEDIR in a WDL file), but I am just frustrated / surprised that it does not (apparently) point to the work directory as it should (according to the manual) ...

Cheers,
Andreas


____________________________________________________
GameCore / Unity / UDK
Lightwave 9.6 / Blender / Fragmotion / ZBrush 3.5
TextureMaker / PSP-X
Re: Where does save_dir get its value ? [Re: Andreas C] #247223
01/19/09 15:10
01/19/09 15:10
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
Normally this should be correct. If you write a file with fopen, e.g. fopen("test.txt","wb"); without an specific absolute path, the file is automatically created in the work folder of your game.

Therefore it's correct that if save_dir is "" it means the same as if it was filled with the "real" work dir.

BTW: You do not need a wdl file, or the -dir command. It's just enough to copy a string into save_dir (e.g. str_cpy(save_dir,work_dir); )


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1