• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code [Help] Constant Fire Sound/Animation Limitation

it didnt work either, so i now got everything working correctly, except the altfire uses healingcharge instead of primary ammo...
That really such a great idea? Must be a way round it like an if statement that will see which is being fired etc to do what fire rate, if not make a second fire rate code that will affect the fire?
 
Upvote 0
it didnt work either, so i now got everything working correctly, except the altfire uses healingcharge instead of primary ammo...

What you should do is extend KFWeapon instead of the MP7 and add this code:

Code:
simulated function bool StartFire(int Mode)
{
 if( Mode == 1 )
  return super.StartFire(Mode);
 if( !super.StartFire(Mode) )  // returns false when mag is empty
    return false;
 if( AmmoAmount(0) <= 0 )
 {
     return false;
    }
 AnimStopLooping();
 if( !FireMode[Mode].IsInState('FireLoop') && (AmmoAmount(0) > 0) )
 {
  FireMode[Mode].StartFiring();
  return true;
 }
 else
 {
  return false;
 }
 return true;
}
simulated function AnimEnd(int channel)
{
    local name anim;
    local float frame, rate;
 if(!FireMode[0].IsInState('FireLoop'))
 {
        GetAnimParams(0, anim, frame, rate);
        if (ClientState == WS_ReadyToFire)
        {
             if ((FireMode[0] == None || !FireMode[0].bIsFiring) && (FireMode[1] == None || !FireMode[1].bIsFiring))
            {
                PlayIdle();
            }
        }
 }
}
simulated function bool CanZoomNow()
{
 Return (!FireMode[0].bIsFiring && Instigator!=None && Instigator.Physics!=PHYS_Falling);
}

Then put all the default properties you would find in a standard Killing Floor weapon but you might want to change some properties so it fits the weapon.
 
Upvote 0
Right im trying to fix up the last of my P90 port. For some reason the third person animations wont play the reload animation. Where can I set this as I want to use a assault rifle reload animation? Im guessing this is in the weapon's attachment file.

EDIT:
Sorry found the problem. It's inside the weapon's class as defaultproperty
Code:
WeaponReloadAnim="Reload_[COLOR=red]WeaponChoice[/COLOR]"
 
Last edited:
Upvote 0