- Joined
- May 2, 2013
- Messages
- 96
- Reaction score
- 141
The weapon side slot is this placement of secondary weapon when you have your primary weapon equipped:
First we go in AI_PlayerAnim.cpp ( \WarZ\src\EclipseStudio\Sources\ObjectsCode\AI\AI_PlayerAnim.cpp )
Remove the lines marked with red
Ok cool, that added the side slot, but now it looks like this:
This only happens with melee weapons, not with pistols etc. if you only allow melee weapons in secondary slot, this is not a problem, but I allow pistols too, so needs a fix..
So let's fix this
In same file (AI_PlayerAnim.cpp)
Add the lines I marked with green
That will rotate the model into place.
Hope this is useful for someone
First we go in AI_PlayerAnim.cpp ( \WarZ\src\EclipseStudio\Sources\ObjectsCode\AI\AI_PlayerAnim.cpp )
Remove the lines marked with red
Code:
void CUberEquip::DrawSlot(ESlot slotId, const D3DXMATRIX& world, DrawType dt, bool skin, bool draw_firstperson, const r3dSkeleton* wpnSkeleton)
{
[COLOR=#FF0000] if(slotId == SLOT_WeaponSide)
return;[/COLOR]
if(draw_firstperson)
{
if(slotId == SLOT_Armor || slotId == SLOT_LowerBody || slotId == SLOT_Head || slotId == SLOT_Helmet || slotId == SLOT_Backpack)
return;
}
Ok cool, that added the side slot, but now it looks like this:
This only happens with melee weapons, not with pistols etc. if you only allow melee weapons in secondary slot, this is not a problem, but I allow pistols too, so needs a fix..
So let's fix this
In same file (AI_PlayerAnim.cpp)
Add the lines I marked with green
Code:
void CUberEquip::Draw(const r3dSkeleton* skel, const D3DXMATRIX& CharMat, bool draw_weapon, DrawType dt, bool first_person)
{
//todo: call extern void r3dMeshSetWorldMatrix(const D3DXMATRIX& world)
// instead of mesh->SetWorldMatrix
// in first person mode we need to render player and gun into different Z range
if(dt == DT_AURA)
{
float expandConst[ 4 ] = { r_aura_extrude->GetFloat(), 0.f, 0.f, 0.f } ;
D3D_V(r3dRenderer->pd3ddev->SetVertexShaderConstantF(23, expandConst, 1)) ;
}
skel->SetShaderConstants();
for(int i=0; i<=SLOT_Backpack; i++)
{
DrawSlot((ESlot)i, CharMat, dt, true, first_person, NULL);
}
if(dt != DT_AURA)
{
D3DXMATRIX world = getWeaponBone(skel, CharMat);
if(!first_person)
{
if(slots_[SLOT_WeaponBackRight].wpn)
{
skel->GetBoneWorldTM("Weapon_BackRight", &world, CharMat);
DrawSlot(SLOT_WeaponBackRight, world, dt, false, first_person, NULL);
}
if(slots_[SLOT_WeaponSide].wpn)
{
skel->GetBoneWorldTM("Weapon_Side", &world, CharMat);
[COLOR=#00CC00] if(slots_[SLOT_WeaponSide].wpn->getCategory() == storecat_MELEE) {
D3DXMATRIX mr1;
D3DXMatrixRotationYawPitchRoll(&mr1, 0, R3D_PI/2 + 40, 30);
skel->GetBoneWorldTM("Weapon_Side", &world, CharMat);
world = mr1 * world;
}[/COLOR]
DrawSlot(SLOT_WeaponSide, world, dt, false, first_person, NULL);
}
}
Hope this is useful for someone
Last edited:

