ent_create function from text file

Posted By: crumply

ent_create function from text file - 08/21/08 23:47

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]

Posted By: Fenriswolf

Re: ent_create function from text file - 08/22/08 06:58

Hello,

engine_getscript should do the job.
Posted By: flits

Re: ent_create function from text file - 08/22/08 11:17

it works here

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

Re: ent_create function from text file - 08/22/08 12:48

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?
© 2024 lite-C Forums