Acttable t: Difference between revisions
Jump to navigation
Jump to search
Bug:CBaseCombatWeapon::ActivityOverride(), which executes an ActTable, is not called from base code. See m_PlayerAnimState#Implementation to fix this.
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified) |
Le Glaconus (talk | contribs) (formatting) |
||
Line 1: | Line 1: | ||
{{ | {{languageBar|title={{mono|acttable_t}}}} | ||
''' | '''{{code|acttable_t}}''' defines translations between the generic [[Activity|activities]] generated by a [[PlayerAnimState]] object into ones specific to the current weapon. For instance, {{code|ACT_MP_STAND_IDLE}} might be translated into {{code|ACT_DOD_STAND_AIM_RIFLE}} by the Rifle weapon. | ||
If a weapon doesn't have an ActTable, or has an incomplete one, you are likely to find your player models losing all animations in some conditions. | If a weapon doesn't have an {{mono|ActTable}}, or has an incomplete one, you are likely to find your player models losing all animations in some conditions. | ||
{{bug|hidetested=1| | {{bug|hidetested=1|{{code|[[CBaseCombatWeapon]]::ActivityOverride()}}, which executes an {{mono|ActTable}}, is not called from base code. See [[m_PlayerAnimState#Implementation]] to fix this.}} | ||
== Implementation == | == Implementation == | ||
Add | Add {{code|DECLARE_ACTTABLE()}} to both the client and server classes. Then, in the shared code: | ||
<source lang=cpp> | <source lang=cpp> | ||
Line 25: | Line 25: | ||
The third value is whether the animation is "required" or not. {{todo|Meaning of this.}} | The third value is whether the animation is "required" or not. {{todo|Meaning of this.}} | ||
[[Category:Weapons programming]][[Category:Structures]] | [[Category:Weapons programming]][[Category:Structures]] |
Latest revision as of 10:02, 28 May 2025
acttable_t defines translations between the generic activities generated by a PlayerAnimState object into ones specific to the current weapon. For instance, ACT_MP_STAND_IDLE might be translated into ACT_DOD_STAND_AIM_RIFLE by the Rifle weapon.
If a weapon doesn't have an ActTable, or has an incomplete one, you are likely to find your player models losing all animations in some conditions.

Implementation
Add DECLARE_ACTTABLE() to both the client and server classes. Then, in the shared code:
acttable_t CMyWeapon::m_acttable[] =
{
{ ACT_MP_STAND_IDLE, ACT_MYMOD_STAND_AIM_MYWEAPON, false },
{ ACT_MP_CROUCH_IDLE, ACT_MYMOD_CROUCH_AIM_MYWEAPON, false },
{ ACT_MP_RUN, ACT_MYMOD_RUN_MYWEAPON, false },
// etc.
};
IMPLEMENT_ACTTABLE( CMyWeapon );
The third value is whether the animation is "required" or not.
Todo: Meaning of this.