Hi ASallade, thanks again for your help. It's definitely not the jump animation, as I've been using a test model which only has a walking animation at the moment, so when he jumps the animation just freezes. The array idea sounds interesting. The code I'm using to test ent_vertex is a modified version of the office.wdl - I've just added the following two functions:
function vertices(vertex) // updates the position of the vertex...
{
while(1) // this should already be a loop
{
ent_vertex(position,vertex); //'position' records the vertex position
wait(1);
}
}
function attach_object
{
while(1)
{
if (you == player && person_3rd == 0) {
my.invisible = on;
} else {
my.invisible = off;
}
vec_set(my.x,position); // origin of new model is set to vertex position
vec_set(my.pan,you.pan);
wait(1);
}
}
And then I've added these two lines:
vertices(26);
create(<blow.mdl>,nullvector,blow_detector);
after everything in the player_client script, like this:
function player_client()
{
MY.FAT = OFF;
MY.NARROW = ON; // set narrow hull
MY._WALKFRAMES = 1; // enable frame name animation
MY._FORCE = 0.5; // He should be not too fast
MY._MOVEMODE = _MODE_WALKING;
MY._BANKING = -0.1;
MY.__JUMP = ON;
MY.__DUCK = ON;
MY.__STRAFE = ON;
MY.__BOB = ON;
MY.__TRIGGER = ON;
MY.ENABLE_DISCONNECT = ON;
MY.EVENT = _actor_connect;
player_move();
if (MY.shadow == OFF) { drop_shadow(); }
vertices(26);
create(<blow.mdl>,nullvector,blow_detector);
}
Like in the office demo, the character is then controlled using player_prog (ie that is chosen from the list in the Properties panel for the character model:
ACTION player_prog
{
ifDEF CLIENT;
remove(ME); // each client generates his own player
ifELSE;
player_client();
ENDif;
END;
}
I have tried putting the vertices() and create() line in this player_prog() section instead, but still the same problem.
Anyway, thanks again.
Cheers,
Ambit