Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (dr_panther, AndrewAMD, Ayumi, TedMar), 1,033 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_create function from text file #223033
08/21/08 23:47
08/21/08 23:47
Joined: Mar 2008
Posts: 67
crumply Offline OP
Junior Member
crumply  Offline OP
Junior Member

Joined: Mar 2008
Posts: 67
Hey,

I'm reading from a text file and I want to define a created entity's action by reading a string but it won't let me I get an engine error (E1513). It's the third parameter in ent_create that fails when I put a string in place of NULL. If NULL is there it runs fine but my entity then has no behaviour.

Code:
		//Place level objects (inc trees)
			file_find(fhandle,"[objects]");
			while(eoo < 1){
				file_str_read (fhandle,tempstr);
				if(str_cmpni(tempstr,"[endobjects]")){
					eoo = 1;
				} else{
					temppos.x = file_var_read(fhandle);
					temppos.y = file_var_read(fhandle);
					temppos.z = file_var_read(fhandle);
					file_str_read(fhandle,tempstr2);
					ent_create(tempstr,temppos,NULL);
				}
			
			}


Here's my text file:
Code:
[objects]
palm.mdl	0	0	250	tree
palm.mdl	100	300	250	tree
[endobjects]


Re: ent_create function from text file [Re: crumply] #223053
08/22/08 06:58
08/22/08 06:58
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hello,

engine_getscript should do the job.

Re: ent_create function from text file [Re: Fenriswolf] #223105
08/22/08 11:17
08/22/08 11:17
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
it works here

check this 2 things
-is the model realy in the folder and not in a subfolder
- STRING* tempstr = ""; dont forget = ""


"empty"
Re: ent_create function from text file [Re: flits] #223123
08/22/08 12:48
08/22/08 12:48
Joined: Mar 2008
Posts: 67
crumply Offline OP
Junior Member
crumply  Offline OP
Junior Member

Joined: Mar 2008
Posts: 67
Well it loads the models and places them without any error, it just doesn't assign them actions frown

Edit:

How would you go about creating an entity and assigning it a behaviour if you had the entity model, coords and desired behaviour type in a text file?

Last edited by crumply; 08/22/08 13:32.

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