Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[Help] Save_dir #443090
07/09/14 03:43
07/09/14 03:43
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Code:
str_cpy(save_dir,"C:\\ProgramData\\DLively\\Subfolder\\save_dir")

filehandle = file_open_write ("%SAVE_DIR%\\scores.txt");
if(filehandle == 1){
		
	file_str_write(filehandle,end_input_name_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_1_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_2_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_3_str_i);
	file_str_write(filehandle,",");
		
	file_str_write(filehandle,input_name_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_1_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_2_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_3_str_i);
		
	file_close (filehandle); 
}
else beep();



This worked once and created the file in this directory - Then I deleted it to see if it would do it again - and no. not only that, but nothing was inputted inside.

Last edited by DLively; 07/09/14 03:45.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #443111
07/09/14 15:32
07/09/14 15:32
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Okay,this crates the scores.txt, but does not fill in the scores.txt with the required fields:

filehandle = file_open_write ("C:\\ProgramData\\DLively\\Subfolder\\save_dir\\scores.txt");
if(filehandle == 1){

file_str_write(filehandle,end_input_name_str_i);
file_str_write(filehandle,",");

Last edited by DLively; 07/09/14 15:32.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #443112
07/09/14 15:44
07/09/14 15:44
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
HI,
the filehandle variable value will probably change each run and it will probably never be equal to one.

Code:
if ( filehandle != 0 )
{...



Salud!

Re: [Help] Save_dir [Re: txesmi] #443125
07/09/14 18:41
07/09/14 18:41
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Ah there we go laugh

That was the issue, Thank you much txesmi


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #476341
02/19/19 19:03
02/19/19 19:03
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I can't seem to get my game to create a folder. Does this script create a folder, or just create a file into an existing folder?


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