• 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 Weapon Perk Index and the Trader

lerson

Member
Jun 24, 2011
7
0
So, if there's been anybody who follows the Per Server Stats thread, you may have seen the discussion about the perk icons in the trader, and how they don't correspond to any new perks you create. So, as I have a question or two about this and I don't imagine it really being a problem exclusive to that mod, here goes, two questions:

1. How would I go about changing what perk index an existing weapon adheres to? Say I wanted to change the Crossbow from a sharpshooter weapon to a demolition weapon- purely in the trader's list, not in terms of bonuses or anything- how would I go about that?

2. Does anybody happen to know where exactly the perk index grabs the icons for for the trader weapons? I created a new perk using Marco's server perks system, and it follows perk index 7, but it does not use the icon given to it within Marco's code, which leads me to believe I'd need to mess with something elsewhere.

Anybody? Thanks!
 
Upvote 0
I'll share what I know so far. There is some file (not sure if it's in KF itself or Macro's mutator) that is limiting the trader to show the specific perks as that is all the game should be looking for I guess. The file I have no clue at this point but are you using KFCustomTrader mutator aswel? Im starting to think this may be part of it too.
I am using that, yeah. Perhaps I'll poke about in the KFCustomTrader files and see if there's anything that would be limiting it.
 
Upvote 0
1. You have to change the CorrespondingPerkIndex to match the perk you want the weapon to show up as in the trader. You change this in the default properties with a new weapons pickup file. e.g.

MyCrossbowPickup.uc file
Code:
class MyCrossbowPickup extends CrossbowPickup;
 
defaultproperties
{
     CorrespondingPerkIndex=6
}

Heres the perk index numbers.

Perks(0)="FieldMedic"
Perks(1)="SupportSpec"
Perks(2)="Sharpshooter"
Perks(3)="Commando"
Perks(4)="Berserker"
Perks(5)="Firebug"
Perks(6)="Demolitions"

2. Not sure how this works. The game seems to limit the the perks. You can create perks and add them. But the trader icon is always blank. I dont think the game allows you to expand the perks, or i havent found the right way. The icons will show everywhere but the trader buy menu.
 
Upvote 0
1. You have to change the CorrespondingPerkIndex to match the perk you want the weapon to show up as in the trader. You change this in the default properties with a new weapons pickup file. e.g.

MyCrossbowPickup.uc file
Code:
class MyCrossbowPickup extends CrossbowPickup;
 
defaultproperties
{
     CorrespondingPerkIndex=6
}

Heres the perk index numbers.

Perks(0)="FieldMedic"
Perks(1)="SupportSpec"
Perks(2)="Sharpshooter"
Perks(3)="Commando"
Perks(4)="Berserker"
Perks(5)="Firebug"
Perks(6)="Demolitions"

2. Not sure how this works. The game seems to limit the the perks. You can create perks and add them. But the trader icon is always blank. I dont think the game allows you to expand the perks, or i havent found the right way. The icons will show everywhere but the trader buy menu.

This is what i've been trying to explain to you and others! :p

I only have tested this by using custom weapons within my custom ServerPerks mutator which i've put with custom perks. Really have no clue where this is at this point but im still poking around for it. Aslong as we find where it is we could easily override the current code so that it'll fit our needs I guess.
 
Upvote 0