Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: save entity to folder [Re: Aku_Aku] #400477
05/01/12 18:30
05/01/12 18:30
Joined: Apr 2008
Posts: 245
GameScore Offline OP
Member
GameScore  Offline OP
Member

Joined: Apr 2008
Posts: 245
i was try the same thing
don`t work


Code:
void load_model()
{
	
	long i;
	STRING* path_str=str_create(" ");// set the path
   
	char* filename = file_dialog("Import model","*.mdl;");
	if (filename)
	{
		
	void* new_ent = file_load(filename,NULL,i);
        add_buffer(filename,new_ent,i);
        str_cpy(path_str,"save_dir\\");
        str_cat(path_str,filename);
	file_save(path_str,new_ent,i);
       
   
    
	wait(-1);
	editing_ent = ent_create (filename,vector(100,0,0),test_mdl);
	

	
   }
		
}



Re: save entity to folder [Re: Aku_Aku] #400496
05/02/12 10:03
05/02/12 10:03
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Try this and use http://www.conitec.net/beta/aerror.htm to check if the string is right:


Code:
str_cpy(some_empty_string, save_dir);
str_cat(some_empty_string, "//"); // or "\\"
str_cat(some_empty_string, your_model_file_name_string);




no science involved
Re: save entity to folder [Re: GameScore] #400497
05/02/12 10:07
05/02/12 10:07
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
maybe remove the space?
STRING* path_str=str_create(" ");// set the path -> STRING* path_str=str_create("");// set the path


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: save entity to folder [Re: sivan] #400499
05/02/12 11:08
05/02/12 11:08
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Of course this won´t work:
str_cpy(path_str,"save_dir\\");

Because you copy the string "save_dir" and not the content of save_dir.


no science involved
Re: save entity to folder [Re: fogman] #400525
05/02/12 19:45
05/02/12 19:45
Joined: Apr 2008
Posts: 245
GameScore Offline OP
Member
GameScore  Offline OP
Member

Joined: Apr 2008
Posts: 245
now i got what i done wrong
the path was the problem

if i write it in this way

Code:
str_cpy(some_empty_string, save_dir);


it does not work, couz the save_dir contains not the full path
if i declare save_dir like this ( like the manual describes )
Code:
str_cpy(save_dir,"game_scores");


save_dir contains only game_scores but not the full path
i saw it when i write this to a textfile
Code:
file_str_write(save,save_dir);


so, everytime when i copy this entity it was copied into oblivion


now i use this solution

Code:
STRING* path_str = str_create(_chr("\\models\\"));
STRING* target_name = str_create(_chr(work_dir));
str_cat(target_name,path_str);
str_cat(target_name,filename);
file_cpy(target_name, filename);




but thanks for all your help

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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