UE3 - General Animation Code problems

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FlamingRain

New Member
May 31, 2010
4
0
0
So, I don't have much coding experience (for UDK my main position is an animator) and I wanted to change something that Unreal does.
Unreal scales your firing animation based on your fireinterval. For automatic weapons, this makes the animation look sped up (because I have a recoil and kick-back to origin that would happen after you let go of the trigger). I attempted to correct this by looking at the UTWeapon script, and then, overwriting the script/function in my new EOWeapon script.
Code:
/********************************************/
simulated function PlayFireEffects( byte FireModeNum, optional vector HitLocation )
{
	// Play Weapon fire animation

	if ( FireModeNum < WeaponFireAnim.Length && WeaponFireAnim[FireModeNum] != '' )
		PlayWeaponAnimation( WeaponFireAnim[FireModeNum], GetFireInterval(FireModeNum) );
	if ( FireModeNum < ArmFireAnim.Length && ArmFireAnim[FireModeNum] != '' && ArmsAnimSet != none)
		PlayArmAnimation( ArmFireAnim[FireModeNum], GetFireInterval(FireModeNum) );

	// Start muzzle flash effect
	CauseMuzzleFlash();

	ShakeView();
}
I tried many variations of editing this, such as removing FireModeNum from the function's body, and then I also tried replacing FireModeNum with DefaultAnimSpeed, and obviously, I have no clue what I'm doing so I could use a little assist.
Is there a way I can make the firing animation play at the default speed the animation is animated at rather than scaling it based on the FireInterval?
Thanks, and all help appreciated.
 

brold9999

New Member
Apr 5, 2009
142
0
0
The second parameter to PlayWeaponAnimation and PlayArmAnimation is the amount of time for the animation to play for. From a quick glance at the code it appears that it plays at the normal rate if that parameter is zero.

So, in this case, you want to replace GetFireInterval(FireModeNum) with 0.
 

FlamingRain

New Member
May 31, 2010
4
0
0
Thanks, the animation plays at full length now, but the animation will snap back to the idle animation/origin when it's able to be shot again rather than continue the animation.
 

brold9999

New Member
Apr 5, 2009
142
0
0
My initial intuition is that another animation (likely the idle animation) is being started when the weapon can be fired again and it's overriding the animation currently playing.