Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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

Newbie Spellweaver
Joined
Apr 19, 2008
Messages
23
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:
Newbie Spellweaver
Joined
Apr 23, 2014
Messages
39
Reaction score
17
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
 
Skilled Illusionist
Joined
May 17, 2013
Messages
309
Reaction score
206
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:
Banned
Banned
Joined
May 23, 2015
Messages
10
Reaction score
10
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...
 
Junior Spellweaver
Joined
Oct 12, 2014
Messages
127
Reaction score
22
don't work :(
HQXoQ29 - [tutorials]fix 3rd(3 person mode) mode can't seen weapon Attachments - RaGEZONE Forums

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

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Dec 19, 2015
Messages
67
Reaction score
16
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:
Newbie Spellweaver
Joined
May 9, 2016
Messages
81
Reaction score
3
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

You must be registered for see attachments list
Newbie Spellweaver
Joined
May 9, 2016
Messages
81
Reaction score
3
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

You must be registered for see attachments list
Newbie Spellweaver
Joined
Dec 26, 2014
Messages
16
Reaction score
9
@zsh7954

I don't know what you did wrong... but its not the fault of my tutorials...

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

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
May 9, 2016
Messages
81
Reaction score
3
Well, I don't seem to be using it. Thank you for giving me the tutorial. In a word, thank you very much.
@zsh7954

I don't know what you did wrong... but its not the fault of my tutorials...

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

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Oct 25, 2017
Messages
158
Reaction score
17
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;}

 
Experienced Elementalist
Joined
May 28, 2017
Messages
225
Reaction score
127
@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...
 
Junior Spellweaver
Joined
Oct 25, 2017
Messages
158
Reaction score
17
@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
Top