[tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments

Newbie Spellweaver
Joined
Apr 19, 2008
Messages
22
Reaction score
5
open Weapon.cpp
Code:
r3dMesh* WeaponConfig::getMesh( bool allow_async_loading, bool first_person ) const
{
[COLOR="#00FF00"]	extern bool g_bEditMode;
	if(!g_bEditMode) // do not check this in editor to allow artists to test models without changing DB
		if(!IsFPS)
			first_person = false;

	if( first_person )
	{
		if(m_Model_FPS == 0)
		{

#ifndef FINAL_BUILD
			if(g_bEditMode && !r3dFileExists(m_ModelPath_1st))
			{
				char buf[128];
				sprintf(buf, "FPS model isn't available for %s", FNAME);
				MessageBox(NULL, buf, "Warning", MB_OK);
				m_Model_FPS = m_Model;
			}
			else
#endif
			{
				m_Model_FPS = r3dGOBAddMesh(m_ModelPath_1st, true, false, allow_async_loading, true );
				if(m_Model_FPS==0)
				{
					r3dError("ART: failed to load mesh '%s'\n", m_ModelPath_1st);
				}
				r3d_assert(m_Model_FPS);
			}
		}

		return m_Model_FPS;
	}

	r3d_assert( m_Model ) ;

	return m_Model;[/COLOR]
}
change it
m_Model_FPS = r3dGOBAddMesh(m_ModelPath_1st, true, false, allow_async_loading, true );
if(m_Model_FPS==0)
{
r3dError("ART: failed to load mesh '%s'\n", m_ModelPath_1st);
}
r3d_assert(m_Model_FPS);

return m_Model_FPS;

2.
Code:
	R3DPROFILE_FUNCTION("Weapon::Update");
	
	obj_Player* player = (obj_Player*)m_Owner;
	if(!m_isMeshLoaded)
	{
		m_isMeshLoaded = isLoaded();
		if(m_isMeshLoaded)
		{
			m_pConfig->updateMuzzleOffset(g_camera_mode->GetInt()==2 && player->NetworkLocal);
[COLOR="#FF0000"]			if(g_camera_mode->GetInt()==2 && player->NetworkLocal)
				checkForSkeleton();[/COLOR]
		}
	}
change :
Code:
			m_pConfig->updateMuzzleOffset(g_camera_mode->GetInt()==2 && player->NetworkLocal);
		[COLOR="#00FF00"]	//if(g_camera_mode->GetInt()==2 && player->NetworkLocal)[/COLOR]
				checkForSkeleton();
 
Last edited:
I could not understand what you said to do in the first part that you say to change!You could post how was your code? Thank you
Really? You have to replace everyting (already tested)... So hard to read?

Btw, hammerpoint is big crap, can even make good item models ^^
xingbarking - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums


xingbarking - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums
 
Last edited:
Really? You have to replace everyting (already tested)... So hard to read?

Btw, hammerpoint is big crap, can even make good item models ^^
xingbarking - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums


xingbarking - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums


They do..

You just used wrong model to load in the tps....

use _FPS model not _AIM model...
 
Open weapon.cpp? Auehaueu.
Just replace the first code with the second. However this won't work 100% as bones etc aren't made for this. It does show attachments, but not perfectly if I remember correctly.
 
Last edited:
Players can not see that in addition to the muzzle of the accessories, I will take a picture.



I will bring the picture below.
 

Attachments

  • I s - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums
    I see.webp
    48.8 KB · Views: 296
  • Others s - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums
    Others see..webp
    17.3 KB · Views: 207
  • Weapons on my back - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums
    Weapons on my back..webp
    24.2 KB · Views: 269
I follow your tutorial, but he doesn't have any effect.
I dont know why I do this for you...

But here you got the solution of your problem:

Go open WarZ.Sln

Code:
Search for:

slot.Attachment[0].attachments[WPN_ATTM_MUZZLE]    = n.Attm0.MuzzleID;

in ClientGameLogic.cpp

[B]EXAMPLE:[/B]
replace all slot.Attachment[0].attachments[..........] = n...........; & slot.Attachment[1].attachments[..........] = n...........;

[B]NOW LET IT LOOKS LIKE THIS HERE:[/B]

        slot.Attachment[0].attachments[WPN_ATTM_MUZZLE]    = n.Attm0.MuzzleID;
        slot.Attachment[0].attachments[WPN_ATTM_LEFT_RAIL] = n.Attm0.LeftRailID;
        slot.Attachment[0].attachments[WPN_ATTM_UPPER_RAIL] = n.Attm0.UpperRailID;
        slot.Attachment[0].attachments[WPN_ATTM_BOTTOM_RAIL] = n.Attm0.BottomRailID;
        slot.Attachment[0].attachments[WPN_ATTM_CLIP] = n.Attm0.ClipID;
        slot.Attachment[1].attachments[WPN_ATTM_MUZZLE]    = n.Attm1.MuzzleID;
        slot.Attachment[1].attachments[WPN_ATTM_LEFT_RAIL] = n.Attm1.LeftRailID;
        slot.Attachment[1].attachments[WPN_ATTM_UPPER_RAIL] = n.Attm1.UpperRailID;
        slot.Attachment[1].attachments[WPN_ATTM_BOTTOM_RAIL] = n.Attm1.BottomRailID;
        slot.Attachment[1].attachments[WPN_ATTM_CLIP] = n.Attm1.ClipID;

Code:
Search for:

CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_MUZZLE]    = n.Attm.MuzzleID;

in AI_Player.cpp

replace it again and let it looks like:

        CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_MUZZLE]    = n.Attm.MuzzleID;
    CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_LEFT_RAIL] = n.Attm.LeftRailID;
    CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_UPPER_RAIL]    = n.Attm.UpperRailID;
    CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_BOTTOM_RAIL]    = n.Attm.BottomRailID;
    CurLoadout.Attachment[n.wid].attachments[WPN_ATTM_CLIP]    = n.Attm.ClipID;

Code:
Search for:

struct wiNetWeaponAttm

in P2PMessages.h

replace the hole function with:

struct wiNetWeaponAttm
{
    DWORD        LeftRailID;
    DWORD        MuzzleID;
    DWORD        UpperRailID;
    DWORD        BottomRailID;
    DWORD        ClipID;
    
    wiNetWeaponAttm()
    {
      LeftRailID = 0;
      MuzzleID   = 0;
      UpperRailID = 0;
      BottomRailID = 0;
      ClipID = 0;
    }
};

Now go open WarZ_Server.Sln

Code:
Search for:

wiNetWeaponAttm    obj_ServerPlayer::GetWeaponNetAttachment(int wid)

in obj_ServerPlayer.cpp

replace the hole function with:

wiNetWeaponAttm    obj_ServerPlayer::GetWeaponNetAttachment(int wid)
{
    wiNetWeaponAttm atm;
    
    const ServerWeapon* wpn = m_WeaponArray[wid];
    if(!wpn)
        return atm;
    
    if(wpn->m_Attachments[WPN_ATTM_LEFT_RAIL])
        atm.LeftRailID = wpn->m_Attachments[WPN_ATTM_LEFT_RAIL]->m_itemID;
    if(wpn->m_Attachments[WPN_ATTM_MUZZLE])
        atm.MuzzleID = wpn->m_Attachments[WPN_ATTM_MUZZLE]->m_itemID;
    if(wpn->m_Attachments[WPN_ATTM_UPPER_RAIL])
        atm.UpperRailID = wpn->m_Attachments[WPN_ATTM_UPPER_RAIL]->m_itemID;
    if(wpn->m_Attachments[WPN_ATTM_BOTTOM_RAIL])
        atm.BottomRailID = wpn->m_Attachments[WPN_ATTM_BOTTOM_RAIL]->m_itemID;
    if(wpn->m_Attachments[WPN_ATTM_CLIP])
        atm.ClipID = wpn->m_Attachments[WPN_ATTM_CLIP]->m_itemID;


    return atm;
}



And I have a gun in the shape of the problem.



I will attach a picture.
 

Attachments

  • QQ截图20161126102935 - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums
    QQ截图20161126102935.webp
    20.9 KB · Views: 331
For those who do not understand what needs to be done
FIND:r3dMesh* WeaponConfig::getMesh( bool allow_async_loading, bool first_person ) const
Delete everything that was green text and paste it
r3dMesh* WeaponConfig::getMesh( bool allow_async_loading, bool first_person ) const{ m_Model_FPS = r3dGOBAddMesh(m_ModelPath_1st, true, false, allow_async_loading, true ); if(m_Model_FPS==0) { r3dError("ART: failed to load mesh '%s'\n", m_ModelPath_1st); } r3d_assert(m_Model_FPS); return m_Model_FPS;}

 
@Lomoda its more than only this.... to make that everyone see's your attm you have to make the netcode but well its copy pasta and rename than you have to fix the wepon skl. at your backside + a game crash but I made a tut to fix all this...
 
@Lomoda its more than only this.... to make that everyone see's your attm you have to make the netcode but well its copy pasta and rename than you have to fix the wepon skl. at your backside + a game crash but I made a tut to fix all this...
I understand this, but it's better than nothing.
 
Back