• 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 [Tutorial] Custom Perks

That should look like this, adds new stuff to the old equipment instead of exchanging it.
Very poorly written. It's also wrong because bad spacing (indentation only works for one line) and missing an else for each if past the first one if you're going to do the entire list each time.

The original should work, given that CreateInventoryVeterancy works and doesn't check weight.
Code:
static function AddDefaultInventory(KFPlayerReplicationInfo KFPRI, Pawn P)
{    
    if ( KFPRI.ClientVeteranSkillLevel >= 50 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.M99SniperRifle", GetCostScaling(KFPRI, class'M99Pickup'));
    if ( KFPRI.ClientVeteranSkillLevel >= 40 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.SPSniperRifle", GetCostScaling(KFPRI, class'SPSniperPickup')); 
    if ( KFPRI.ClientVeteranSkillLevel >= 30 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.M14EBRBattleRifle", GetCostScaling(KFPRI, class'M14EBRPickup'));
    if ( KFPRI.ClientVeteranSkillLevel >= 20 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Crossbow", GetCostScaling(KFPRI, class'CrossbowPickup'));
    if ( KFPRI.ClientVeteranSkillLevel >= 10 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Winchester", GetCostScaling(KFPRI, class'WinchesterPickup')); 
    if ( KFPRI.ClientVeteranSkillLevel >= 7 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.GoldenDualDeagle", GetCostScaling(KFPRI, class'GoldenDualDeaglePickup'));   
    if ( KFPRI.ClientVeteranSkillLevel >= 6 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Dual44Magnum", GetCostScaling(KFPRI, class'Dual44MagnumPickup'));
    if ( KFPRI.ClientVeteranSkillLevel >= 5 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.DualMK23Pistol", GetCostScaling(KFPRI, class'DualMK23Pickup'));
    if ( KFPRI.ClientVeteranSkillLevel >= 0 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Dualies", GetCostScaling(KFPRI, class'DualiesPickup'));        
}
Just read Krayzie's post again. I have no idea why it's not working, but your code won't fix it.
 
Last edited:
Upvote 0
Gartley;n1576169 said:
Tutorial Two : Extending and Overriding Perks

We will start simply to begin with. Now you can find ALL the functions you need in other files, both in the original perks in the KFMod folder in your .../killingfloor/ directory and in Marco
i need level up to 254 but when get 71 lv could not up it at all , although i set max lv =254 , so need help, sos
 
Upvote 0
Hi, could anyone tell my why zeds explode after killing them? Someone asked abt it before, but response wasn't clear
Here's his question:
I followed the instructions and created two simple Perks like in Tutorial Three. Everything works fine so far, but I recognized that the Zeds disappear instantly when I kill them with the weapon the Perk uses (eg.: G36C). (only the bodies disappear - gibs and blood are present, which is kind of strange.) This doesn't happen with any other weapon, except there is another perk using another weapon. Any ideas why this happens or how I can fix it?
And response (He also asked abt something else, so this response could be abt other thing)
Do it like this
Code:
static function AddCustomStats( ClientPerkRepLink Other ) { Other.AddCustomValue(Class'MediShotProgress'); Class'WMediShotBullet'.Default.MyDamageType = Class'DamTypeMediShotNew'; }
Can someone explain it better?

Also why this work
Code:
Class'Magnum44Fire'.Default.DamageType = Class'DamTypeMyrmid';
But this doesn't
Code:
Class'M99Fire'.Default.DamageType = Class'DamTypeMyrmid';
What's with M99? I get error: "Unknow Property "DamageType"", why?
(Idk if this is understandable, Eng isn't my native language)
 
Upvote 0
diable122;n2301494 said:
Also why this work
Code:
Class'Magnum44Fire'.Default.DamageType = Class'DamTypeMyrmid';
But this doesn't
Code:
Class'M99Fire'.Default.DamageType = Class'DamTypeMyrmid';
What's with M99? I get error: "Unknow Property "DamageType"", why?
(Idk if this is understandable, Eng isn't my native language)

Ok, I think that, I know why this doesn't work, so now I'd like to know why zeds explode.
 
Upvote 0