Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

PlayWeaponAnimation Does Not Play My Weapon Animation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PlayWeaponAnimation Does Not Play My Weapon Animation

    Hi everyone,
    I have a Pawn class that extends from UTPawn.
    My game in Third Person Mode.
    I have a new weapon and I want to play new animation when weapon fires,
    For using this weapon my Pawn should play animation too, and it works correctly.
    But my weapon animation does not play.

    my weapon class extends from UTWeap_RocketLauncher
    Code:
    class WPSling extends UTWeap_RocketLauncher placeable ;
    ...
    
    simulated function StartFire(byte FireModeNum)
    {
    	if ( bWaitForCombo && (UTBot(Instigator.Controller) != None) )
    	{
    		if ( (ComboTarget == None) || ComboTarget.bDeleteMe )
    			bWaitForCombo = false;
    		else
    			return;
    	}
    	//PlayAnim('WeaponFire');	
    	PlayWeaponAnimation('WeaponFire',2.0,false);
    	Super.StartFire(FireModeNum);
    }
    ...
    
    DefaultProperties
    {
    	bMeleeWeapon=true
    	// Weapon SkeletalMesh
    	Begin Object class=AnimNodeSequence Name=MeshSequenceA
    		bCauseActorAnimEnd=true
    	End Object
    
    	// Weapon SkeletalMesh
    	Begin Object Name=FirstPersonMesh
    		SkeletalMesh=SkeletalMesh'Slingshot.Slingshot'
    		AnimSets(0)=AnimSet'Slingshot.Slingshot_Anim-02'
    		AnimTreeTemplate=AnimTree'Slingshot.SlingShot_AnimTree'
    		Animations=MeshSequenceA		
    		Rotation=(Yaw=-16384) //????????????????????????????????????????????????????????
    		FOV=60.0
    
    	End Object
    	SkelMesh=FirstPersonMesh
    	AttachmentClass=class'TBGame.TBGame_WPSling_Attachment'
    
    	Begin Object Name=PickupMesh
    		SkeletalMesh=SkeletalMesh'Slingshot.Slingshot'
    	End Object
    	
    	InstantHitMomentum(0)=+60000.0
    
    	// define Fire Type 
    	WeaponFireTypes(0)=EWFT_Projectile
    	WeaponFireTypes(1)=EWFT_Projectile
    	FireCameraAnim(1)=CameraAnim'Camera_FX.ShockRifle.C_WP_ShockRifle_Alt_Fire_Shake'
    
    	WeaponFireAnim(1)=WeaponFire //????????????????????????????
    	WeaponFireAnim(0)=WeaponFire
    ...

    I changed my weapon class, it extends UDKWeapon , my weapon animation play correctly but new problems appear.
    after pickup new weapon the current weapon still in player's hand. because it attached to hand.
    in the other world when it extends from UDKWeapon the switching weapon does not work correctly.
    Please Help me.

  • #2
    Have you made a new class to extend off UTAttachment_RocketLauncher ? this is where the 3rd person animations are set

    Comment


    • #3
      Yes, I wrote attachment class
      I should play animation in attachment class ?

      Comment


      • #4
        For example:
        Code:
        class UTAttachment_RocketLauncher extends UTWeaponAttachment;
        /** list of anims to play for loading the RL */
        var array<name> LoadUpAnimList;
        simulated function FireModeUpdated(byte FiringMode, bool bViaReplication)
        {
         if (FiringMode == 1 && Instigator.FlashCount == 0)
         {
          UTAnimNodeSequence(Mesh.Animations).PlayAnimationSet(LoadUpAnimList, 0.5, false);
         }
         else
         {
          Mesh.StopAnim();
         }
        }
        simulated function ThirdPersonFireEffects(vector HitLocation)
        {
         Super.ThirdPersonFireEffects(HitLocation);
         Mesh.StopAnim();
        }
        /** 
        *   Optimized equivalent of calling ThirdPersonFireEffects while in splitscreen
        */
        simulated function SplitScreenEffects(vector HitLocation)
        {
         Super.SplitScreenEffects(HitLocation);
         //Mesh.StopAnim();
        }
        simulated function FirstPersonFireEffects(Weapon PawnWeapon, vector HitLocation)
        {
         Super.FirstPersonFireEffects(PawnWeapon, HitLocation);
         Mesh.StopAnim();
        }
        defaultproperties
        {
         Begin Object Name=SkeletalMeshComponent0
          SkeletalMesh=SkeletalMesh'WP_RocketLauncher.Mesh.SK_WP_RocketLauncher_3P'
          AnimSets[0]=AnimSet'WP_RocketLauncher.Anims.K_WP_RocketLauncher_3P'
          Translation=(X=1,Y=-1,Z=0)
          Rotation=(Roll=1000)
          Scale=1.1
         End Object
         MuzzleFlashSocket=MuzzleFlashSocket
         MuzzleFlashPSCTemplate=WP_RocketLauncher.Effects.P_WP_RockerLauncher_3P_Muzzle_Flash
         MuzzleFlashDuration=0.33;
         MuzzleFlashLightClass=class'UTGame.UTRocketMuzzleFlashLight'
         WeaponClass=class'UTWeap_RocketLauncher'
         LoadUpAnimList[0]=WeaponAltFireQueue1
         LoadUpAnimList[1]=WeaponAltFireQueue2
         LoadUpAnimList[2]=WeaponAltFireQueue3
         FireAnim=WeaponFire
        }

        Comment

        Working...
        X