Results 1 to 4 of 4
  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2011
    Posts
    39

    Default 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.
    Last edited by mahdavi; 02-07-2012 at 06:00 AM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Jan 2008
    Location
    California, USA
    Posts
    181

    Default

    Have you made a new class to extend off UTAttachment_RocketLauncher ? this is where the 3rd person animations are set
    Snake
    Author of UT3Dom mod (Domination games for UT3)

  3. #3
    MSgt. Shooter Person
    Join Date
    Dec 2011
    Posts
    39

    Default

    Yes, I wrote attachment class
    I should play animation in attachment class ?

  4. #4
    MSgt. Shooter Person
    Join Date
    Jan 2008
    Location
    California, USA
    Posts
    181

    Default

    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
    }
    Snake
    Author of UT3Dom mod (Domination games for UT3)


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.