Thanks for helping. Now I it almost works. The animations are shown but the game lags like hell due to assertions. I will show all code I have added/changed to make the animation works.
I have this sequence in my .qc file:
- Code: Select all
$sequence Cast_CastLaunch "poet_cast_launch" activity ACT_LAUNCH 2
which is a animation of the avator launching an attack.
First I added a "ACT_LAUNCH" to the lists in ai_activity.h, ai_activity.cpp and activitylist.cpp. In the "enum PLAYER_ANIM" in shareddefs.h I added "PLAYER_ATTACK2".
I should mention that the game I am working on is seen from a third person view and that I have followed this tutorial (
http://developer.valvesoftware.com/wiki ... son_Camera) to fix the this, which works perfectly.
In the HL2_Player.cpp I have added
- Code: Select all
else if ( playerAnim == PLAYER_ATTACK2 )
{
idealActivity = ACT_LAUNCH;
}
and
- Code: Select all
else if ( idealActivity == ACT_LAUNCH )
{
RestartGesture( Weapon_TranslateActivity( idealActivity ) );
return;
}
I don't understand much of the last code "RestartGesture( ... )".
In the code where the player-avatar launches his attach I added tis line
- Code: Select all
UTIL_GetLocalPlayer()->SetAnimation( PLAYER_ATTACK2 );
When I run this the animation is showed as it should but the I get the following assertions. I get them right after the game starts and I continue to get them like every frame or so untill the game ends.
Clientleafsystem.cpp (330) : Assertion Failed: absMins.IsValid() && absMaxs.IsValid()
Clientleafsystem.cpp (1026) : Assertion Failed: absMins.IsValid() && absMaxs.IsValid()
studio.h (1352) : Assertion Failed: i >= 0 && i < numbones
It seems to be something wrong with the rendering.
Can I just delete the assertions and ignore it or should I fix something?
What does the RestartGesture( Weapon_TranslateActivity( idealActivity ) ); do?