Ahh… I thought you wanted to simply adjust the angles he was facing or if you couldn’t do that then put hiom to the side.
Perhaps, I don’t knwo if theis is an option, but just try it if you can, but since all the tags are named allready, and et allready checks the name of the tags when it adds the parts… can you just add an offset to the tag_torso when it is placed into the world?? Everything else I think attahces to that, so it should still all line up. Haven’t tested this or anything, but this is the same concept I would use to line up my new weapon models instead of rebuilding the entire md3 for positioning.
If that won’t work, this is where you want to look at:
/*
===============
CG_Player
===============
*/
void CG_Player( centity_t *cent )
Of particular interest in this function would be somewhere around here, I briefly tested it out and it worked fine, just make sure to add an offset with the VectorCopy function:
//
// add the body
//
if( cent->currentState.eType == ET_CORPSE && cent->currentState.time2 == 1 ) {
body.hModel = character->undressedCorpseModel;
body.customSkin = character->undressedCorpseSkin;
} else {
body.customSkin = character->skin;
body.hModel = character->mesh;
}
VectorCopy( playerOrigin, body.origin );
VectorCopy( lightorigin, body.lightingOrigin );
body.shadowPlane = shadowPlane;
body.renderfx = renderfx;
VectorCopy( body.origin, body.oldorigin ); // don't positionally lerp at all
cent->pe.bodyRefEnt = body;
Also, in the same function, there is a section of code just above the last block of code I listed, closer to the start of the function, for mounted weapons positioning, you will want to look at that as well:
if( cent->currentState.eFlags & EF_MOUNTEDTANK ) {
VectorCopy( cg_entities[ cg_entities[ cent->currentState.clientNum ].tagParent ].mountedMG42Player.origin, playerOrigin );
} else if( cent->currentState.eFlags & EF_MG42_ACTIVE || cent->currentState.eFlags & EF_AAGUN_ACTIVE ) { // Arnout: see if we're attached to a gun
centity_t *mg42;
int num;
// find the mg42 we're attached to
for ( num = 0 ; num < cg.snap->numEntities ; num++ ) {
mg42 = &cg_entities[ cg.snap->entities[ num ].number ];
if( mg42->currentState.eType == ET_MG42_BARREL &&
mg42->currentState.otherEntityNum == cent->currentState.number ) {
// found it, clamp behind gun
vec3_t forward, right, up;
//AngleVectors (mg42->s.apos.trBase, forward, right, up);
AngleVectors ( cent->lerpAngles, forward, right, up );
VectorMA ( mg42->currentState.pos.trBase, -36, forward, playerOrigin );
playerOrigin[2] = cent->lerpOrigin[2];
break;
}
}
if( num == cg.snap->numEntities ) {
VectorCopy( cent->lerpOrigin, playerOrigin );
}
} else {
VectorCopy( cent->lerpOrigin, playerOrigin );
}