Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Problem with line break #402521
06/06/12 15:17
06/06/12 15:17
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hi, I have to following code:

Code:
ent_create("graphics\\npc\\EarpYellow.tga", nullvector, actEarp);



The compiler tells me the image could not be found because it recognizes a line break at "\n" behind graphics. How can I avoid that?

Re: Problem with line break [Re: PadMalcom] #402523
06/06/12 15:38
06/06/12 15:38
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
try something like this

Code:
STRING*file_name = str_create("graphics\\npc\\EarpYellow.tga");
ent_create(file_name, nullvector, actEarp);



Re: Problem with line break [Re: GameScore] #402608
06/07/12 15:47
06/07/12 15:47
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hey GameScore,
that does not work, same result.

Re: Problem with line break [Re: PadMalcom] #402609
06/07/12 15:56
06/07/12 15:56
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
You could write the string into a textfile and read it out with txt_load.
Then "\n" characters will not be converted to line feeds.

Edit:

TEXT* txt = { strings = 1; flags = SHOW; }

...

txt_load(txt,"paths.txt");
ent_create((txt.pstring)[0], nullvector, actEarp);



no science involved
Re: Problem with line break [Re: fogman] #402611
06/07/12 16:15
06/07/12 16:15
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
or you go the easy way and rename the folder npc

Re: Problem with line break [Re: GameScore] #402613
06/07/12 16:35
06/07/12 16:35
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
It doesnt appear to be the '\n' causing the issue, it just looks like it
because the '\n' gets procss by the error message...

Putting in ANY sort of path into the ent-create seems to generate the error.
its like ent_create cant handle any paths in the string...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Problem with line break [Re: EvilSOB] #402616
06/07/12 16:53
06/07/12 16:53
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
You can just use "/" instead of "\".

Re: Problem with line break [Re: Lukas] #402617
06/07/12 17:02
06/07/12 17:02
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
That dont work (for me) either... Where did that idea come from Lukas?

I had to got this far to get it to go...
Code:
ENTITY* ent_create2(STRING* filename, VECTOR* pos, VOID* actionn)
{
	int size;	void* pFile = file_load(filename, NULL, &size);
	STRING* shortname=str_create(_chr(filename));
	while(str_stri(shortname,"\\"))	str_clip(shortname, str_stri(shortname,"\\"));
	add_buffer(shortname, pFile, size);		
	ENTITY* ent = ent_create(shortname, pos, actionn);		
	add_buffer(shortname, NULL, 0);		file_load(NULL, pFile, 0);
	str_remove(shortname);			return(ent);
}


And I have no idea whats going to happen if you try to load files from
different folders that have the same name....

I suspect the first one to be opened will keep on being reused...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Problem with line break [Re: EvilSOB] #402619
06/07/12 17:14
06/07/12 17:14
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Weired thing is that the entity is actually loaded correctly but acklog.txt prints out this error message.

If there is no elegant solution I'd really rename that folder.

Re: Problem with line break [Re: PadMalcom] #402622
06/07/12 18:40
06/07/12 18:40
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Try renaming the folder as a test....

Then I would think about logging a bug report...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 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