Announcement

Collapse
No announcement yet.

Weird Weapon Animation Problem

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

    Weird Weapon Animation Problem

    Hello,

    I've created a custom weapon and all works well except the secondary fire animation. I can't seem to change the rate at which it plays, which is currently very, very slow. I even tried redoing the animation with some extra "dummy" frames, and the new animation played even more slowly. Is there any way to change the rate at which a firing animation plays?

    It should be noted that this weapon is a charging weapon. When the alternate fire button is hit, it powers up for 1.875 seconds before actually firing a projectile. Could that be the problem?

    Here is the code for the alternate fire in case anyone can help with it.

    Code:
    simulated state AltFire
    {
    	function FireWeapon()
    	{
    		PlayFiringSound();
    		ConsumeAmmo(CurrentFireMode);
    		WeaponPlaySound(SoundCue'WP_FusionCannon.Sounds.FUSIONBlastCue');
    		if ( !Instigator.IsLocallyControlled() )
    		{
    			ClientHasFired();
    		}
    		GotoState('WeaponRecharge');
    	}
    
    	simulated function bool TryPutdown()
    	{
    		bWeaponPutDown = true;
    		return true;
    	}
    
    	function BeginState(Name PreviousStateName)
    	{
    		local UTPawn POwner;
    		local UTAttachment_FusionCannon Attachment;	
    
    		POwner = UTPawn(Instigator);
    		if (POwner != None)
    		{
    			Attachment = UTAttachment_FusionCannon(POwner.CurrentWeaponAttachment);
    			if(Attachment != none)
    			{
    				Attachment.StartCharging();
    			}
    		}
    
    		PowerupSystem.ActivateSystem();
    		PlayWeaponAnimation(PowerupAnim, PowerupTime);
    		WeaponIdleAnims[1] = PowerupAnim;
    		WeaponPlaySound(SoundCue'WP_FusionCannon.Sounds.FusePowerupCue');
    	}
    Begin:
    	sleep(1.875);
    	DestroyEmitters();
    	FireWeapon();
    }
    
    reliable client function ClientHasFired()
    {
    	GotoState('WeaponRecharge');
    }
    
    simulated event RefireCheckTimer()
    {
    }
    
    simulated state WeaponRecharge
    {
    	simulated function BeginState( Name PreviousStateName )
    	{
    		Super.BeginState(PreviousStateName);
    		SetTimer(0.125,false,'Charged');
    		TimeWeaponFiring(0.125);
    
    		AdditionalCoolDownTime = GetTimerRate('RefireCheckTimer') - GetTimerCount('RefireCheckTimer');
    		GoToState('WeaponCoolDown');
    	}
    
    	simulated function EndState(Name NextStateName)
    	{
    		local UTPawn POwner;
    
    		POwner = UTPawn(Instigator);
    		if (POwner != None)
    		{
    			POwner.SetFiringMode(0); // return to base fire mode for network anims
    		}
    		WeaponIdleAnims[1] = default.WeaponIdleAnims[1];
    
    		Super.EndState(NextStateName);
    	}
    
    	simulated function bool IsFiring()
    	{
    		return true;
    	}
    
    	simulated function Charged()
    	{
    		GotoState('Active');
    	}
    }
    
    simulated state WeaponCoolDown
    {
    	simulated function WeaponCooled()
    	{
    		GotoState('Active');
    	}
    
    	simulated function EndState(name NextStateName)
    	{
    		ClearFlashCount();
    		ClearFlashLocation();
    
    		ClearTimer('WeaponCooled');
    		super.EndState(NextStateName);
    	}
    
    begin:
    	SetTimer(CoolDownTime + AdditionalCoolDownTime,false,'WeaponCooled');
    }
Working...
X