this code allows c-scripters to attach a vertex from one entity to a vertex on another entity using mesh deforming. i'll post the code and an explanation:
Code:
entity* ent1;
entity* ent2;
function vertex_to_vertex(e1, vertex1, e2, vertex2)
{
var temp1;
var temp2;
ent1 = e1;
ent2 = e2;
vec_for_vertex (temp1, ent1, vertex1);
vec_set (temp2, temp1);
vec_to_mesh (temp2, ent2, vertex2);
}
vertex_to_vertex (entity 1, vertex 1, entity 2, vertex 2);
entity 1 = the name of the first entity such as "you" or "me"
vertex 1 = the vertex of the first entity to be connected to the second vertex of the second entity
entity 2 = the name of the second entity such as "you" or "me"
vertex 2 = the vertex of the second entity to be connected to the first vertex of the first entity
returns: nothing
uses:
to connect a vertex from one entity to a vertex on another entity
example:
action smoketrail
{
while(you)
{
vertex_to_vertex (me, 1, missile_ent, 30); // connect the top vertex of the smoke to the top vertex of the missile
//code here...
wait(1);
}
}