Hi, I know I've posted and mailed about this before and I'm sorry to be a pain with it, but this is driving me crazy... I thought if I left it a while until I was more familiar with wdl it might come to me, but I still can't figure this out, and I've spent days on it. I'm trying to join two models using ent_vertex, so that the origin of one is attached to a particular vertex of the other. However, no matter what I try I cannot get rid of the lag when the character jumps - and the lag is only visible when he jumps. As I want to create a multipart model where the origin of the head is joined to the top vertex of the torso's neck (eg.), it would look pretty silly if the head sank into the character's shoulders everytime he jumped! Oh, and I've read everything in the manual about avoiding lag and tried everybody's suggestions in other posts (thanks!) - and I've done numerous searches, but all the posts about this seem to end before the problem is solved. This is the code I'm using:
var position[3];
function vertices(vertex) // updates the position of the vertex...
{
while(1)
{
ent_vertex(position,vertex);
wait(1);
}
}
function stay_in_place()
{
while(1){
vec_set(my.x,position.x);
vec_set(my.pan,you.pan);
my.invisible=off;
wait(1);}
}
If you paste this into the office.wdl and then put:
anim_jump_ticks = 15; // slow down jump animation to see lag more clearly
vertices(364); // back belt vertex of warlock.mdl
create(<blow.mdl>,nullvector,stay_in_place);
into the player_client() function immediately after the "create(<staff.mdl>,nullvector,attach_entity);" line, you should see what I mean. You can download the blow.mdl from http://vulcan.spaceports.com/~lethargy/blow.MDL (you'll have to right-click and Save As... - it's just a little cube for test purposes).
Actually, there's another bizarre problem with this code which seems to make no sense at all. I cut and pasted the vertices() and stay_in_place() functions from below the player_client() function to above it, and then when I ran the game the character was below the floor! So I cut and pasted the code back into its original position, but still I had the same problem - even though it had been working perfectly before. Even weirder, I then saved the file, exited WED and restarted and the level was fine. I exited again and restarted and again the character was below the floor. Wha??? Any ideas?
Anyway, if anybody could solve this or tell me exactly why I'm an idiot for missing something obvious, I'd be really grateful.
Thanks,
Keith
[This message has been edited by Ambit (edited 27 April 2001).]