Ok so heres my code:

Code:

//set the model you will be using for the spawned entity
string spawnEntity = "tornado.mdl";
//
//
//set the distance from the target entity you want to spawn to
var spawnDistance = 30;
//
//

action funnel
{
my.invisible=on;
//MOVEMENT CODE OF THE MODEL
}

function spawnTheThing()
{
//get outta here if there aint no target entity in the game
if(funnelEntity == NULL)
{
return;
}

//set temp to the vector of the target entity
vec_set(temp.x, funnelEntity);

//this is the same idea used in a 3rd Person Camera
//it will place the spawned entity behind the target entity
//taking the rotation of the target entity into account
temp.x = funnelEntity.x - spawnDistance * cos(funnelEntity.pan);
temp.y = funnelEntity.y - spawnDistance * sin(funnelEntity.pan);

//set spawnEntityAction to NULL if you do not want to asign it a function
ent_create(spawnEntity,temp.x,tornado);
}



In WED, i place a little box model with the action "funnel" attached to it. In the properties box of the model, I also name it "funnelEntity".

I build, then run, then I get a lot of errors... and it crashes

thanks to help :S

Last edited by Marky Mark; 08/19/07 05:42.

Yeah! IE sucks, use Mozilla...
Marc Rémillard.