|
|
#1 |
![]() Join Date: Jul 2011
Reputation: 0
Posts: 12
|
I have a problem with the preview of my hands in first person. I use the SDK_Template with teams and classes management. When I change my weapon, I have the model of hands dedicated to the weapon (by example with the crowbar, I have the model Gordon Freeman's hands and when I change weapon to take the pistol, I have the model of hands of CSS). Worse, when I pick up the weapon of the other team, I have the same problem ...
How do you keep all the time the same model of hands according to the team and and for the class selected by the player ? Thank you in advance for your help ![]() Sorry for my bad English, but I am a French frog |
|
|
|
|
|
#2 |
![]() Join Date: Mar 2011
Reputation: 38
Posts: 387
|
the weapon viewmodel handles the hands not the player model.
To have the freeman HEV hands you need to add them yourself by decompiling the model and rigging the HEV hands. if you want the hands team based you could use a material proxy. |
|
|
|
|
|
#3 |
![]() Join Date: Jul 2011
Reputation: 0
Posts: 12
|
Thank you for the answer !!!
But I do not see the connection between the proxy material and the model of hands. I have several different models of hands according to the different classes of both teams. This would be possible to have a concrete example ? |
|
|
|
|
|
#4 | |
![]() Join Date: Mar 2011
Reputation: 38
Posts: 387
|
add a proxy material to the hands texture then in code make the proxy change the material depending on the local players team, this is from a search post look at the post for the material file(link at bottom):
Quote:
Last edited by tingtom: 04-23-2012 at 09:31 AM. |
|
|
|
|
|
|
#5 |
![]() Join Date: Jul 2011
Reputation: 0
Posts: 12
|
Thank you very much, I better understand the principle
![]() But there it is about the materials / skins, and not for the use of different models of hands/arms. Would be better with a system of dynamic model for the model of hands/arms ? In the Insurgency mod, they are dynamic models of hands / arms that are used and not dynamic skins. |
|
|
|
|
|
#6 |
![]() Join Date: Mar 2011
Reputation: 38
Posts: 387
|
there are other options such as bodygroups maybe and skins which can be accessed through code.
|
|
|
|
|
|
#7 |
![]() Join Date: Jul 2011
Reputation: 0
Posts: 12
|
With the function SetWeaponModel() of the file baseviewmodel_shared.cpp, I could integrate the management of bodygroup depending on the player's team. Afterward, it will be enough to add two bodygroups "hands" in the file .qc of every weapon.
tingtom, thank you for your answers
|
|
|
|
|
|
#8 |
|
Join Date: Mar 2012
Reputation: 0
Posts: 2
|
I have the same problem.
I added it in the file .qc of my weapons : Code:
$model "arms" "arms_team_red.smd" $model "arms" "arms_team_blue.smd" Code:
void CBaseViewModel::SetWeaponModel( const char *modelname, CBaseCombatWeapon *weapon )
{
m_hWeapon = weapon;
#if defined( CLIENT_DLL )
SetModel( modelname );
#else
string_t str;
if ( modelname != NULL )
{
str = MAKE_STRING( modelname );
}
else
{
str = NULL_STRING;
}
if ( str != m_sVMName )
{
// Msg( "SetWeaponModel %s at %f\n", modelname, gpGlobals->curtime );
m_sVMName = str;
SetModel( STRING( m_sVMName ) );
// Create any vgui control panels associated with the weapon
SpawnControlPanels();
bool showControlPanels = weapon && weapon->ShouldShowControlPanels();
SetControlPanelsActive( showControlPanels );
}
#endif
}
Code:
int iArmsGroup = FindBodygroupByName( "arms" ); if( iArmsGroup == -1 ) return; How can I do this ? |
|
|
|
|
|
#9 |
|
Join Date: Mar 2012
Reputation: 0
Posts: 2
|
Nobody to help me?
|
|
|
|
|
|
#10 |
![]() Join Date: Mar 2011
Reputation: 38
Posts: 387
|
use the weapon to get the owner ( GetOwner() ) then use the player to get the team number ( GetTeamNumber() ) depending on if your on hl2mp or scratch.
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|