How do you properly use ent_create command?

Posted By: JoeMama

How do you properly use ent_create command? - 06/25/06 00:49

I am trying to make it so that on key press h, an entity named KT appears at the origin of the map with the script called troop attached to it. I have looked it up in the manual and found that it is
ent_create (STRING* filename, VECTOR* position, function);
so I created the lines of code at the end of my main fuction like so:
on_h=ent_create (KT.mdl, 0,0,0, troop.wdl);
but it gives me an error saying too many parameters. I have a feeling I am misunderstanding the VECTOR position and function parts of the code.
Posted By: Tempelbauer

Re: How do you properly use ent_create command? - 06/25/06 03:47

you canīt assign parameters by the on_-commands!
you have to write a function, who calls the ent_create:

Code:

function create_something()
{
ent_create (KT.mdl, 0,0,0, troop.wdl);
}

on_h = create_something();


Posted By: Xarthor

Re: How do you properly use ent_create command? - 06/25/06 07:11

well not quite correct the code, you gotta write the vector either into a vector(x,y,z) or, caus you're creating at 0,0,0 the nullvector should work too, not certain though.
Oh and by the way you can only assign ACTIONS to entitys not the whole .wdl file !!
Code:

function create_something()
{
ent_create("KT.mdl",vector(0,0,0),troop_act);
}

on_h = create_something;


Posted By: xboy360

Re: How do you properly use ent_create command? - 06/25/06 09:00

wow! now this i can use! thanks all!

now that last parameter,the troop_act, that
would be the action of the created entity right??
oke..
I saw that tech demo of a6, and on that dynamic lights room,
there were these 2 girls who takes turns catching a ball.
how did they do that?? I am trying to make a basketball game
© 2024 lite-C Forums