• 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 Mut: Per Server Stats

How to set this up properly

How to set this up properly

Hi. I am new here and I tried to install this mutator on my server. I'm using Garena. I put both the mutator itself and the database server in the System folder and configured their ini files to match database port and password. The problem is that the server does not remember my stats each time I get in and basically the database doesn't exist. My Killing Floor does not have a ServerPerksStat.ini to store stats. Can you please explain what I need to do to make this mutator work and have it remember everyone's stats? I wish there's a MySQL version of the database server because it would be much easier to run it through Apache and stuff.

EDIT EDIT EDIT EDIT I figured out that MidGameSaveWaves=1 means it will save the stats after every wave. ==================================================================

Next problem:

What do the values in data.ini correspond to? It's just comma separated values. If I want to modify a player I can't understand a thing!

[84159f68256957d3d67b35cb78c70f]
Crypod=SRVetSharpshooter,0,0,0,20,0,0,395,0,3,1,0,0,0,0,0,9,2,0,40,1144,9,223,0,1
 
Last edited:
Upvote 0
What do the values in data.ini correspond to? It's just comma separated values. If I want to modify a player I can't understand a thing!

[84159f68256957d3d67b35cb78c70f]
Crypod=SRVetSharpshooter,0,0,0,20,0,0,395,0,3,1,0,0,0,0,0,9,2,0,40,1144,9,223,0,1

They come in this order as defined in this function:
Code:
final function string GetSaveData()
{
    local string Result;

    Result = SelectedVeterancy$","$DamageHealedStat$","$WeldingPointsStat$","$ShotgunDamageStat$","$HeadshotKillsStat$","$StalkerKillsStat;
    Result = Result$","$BullpupDamageStat$","$MeleeDamageStat$","$FlameThrowerDamageStat$","$SelfHealsStat$","$SoleSurvivorWavesStat;
    Result = Result$","$CashDonatedStat$","$FeedingKillsStat$","$BurningCrossbowKillsStat$","$GibbedFleshpoundsStat$","$StalkersKilledWithExplosivesStat;
    Result = Result$","$GibbedEnemiesStat$","$BloatKillsStat$","$SirenKillsStat$","$KillsStat$","$ExplosivesDamageStat;
    Result = Result$","$int(TotalZedTimeStat)$","$TotalPlayTime$","$WinsCount$","$LostsCount;
    return Result;
}
 
Upvote 0
They come in this order as defined in this function:
Code:
final function string GetSaveData()
{
    local string Result;

    Result = SelectedVeterancy$","$DamageHealedStat$","$WeldingPointsStat$","$ShotgunDamageStat$","$HeadshotKillsStat$","$StalkerKillsStat;
    Result = Result$","$BullpupDamageStat$","$MeleeDamageStat$","$FlameThrowerDamageStat$","$SelfHealsStat$","$SoleSurvivorWavesStat;
    Result = Result$","$CashDonatedStat$","$FeedingKillsStat$","$BurningCrossbowKillsStat$","$GibbedFleshpoundsStat$","$StalkersKilledWithExplosivesStat;
    Result = Result$","$GibbedEnemiesStat$","$BloatKillsStat$","$SirenKillsStat$","$KillsStat$","$ExplosivesDamageStat;
    Result = Result$","$int(TotalZedTimeStat)$","$TotalPlayTime$","$WinsCount$","$LostsCount;
    return Result;
}

Thank you veeeeery much! :eek:
 
Upvote 0
Wow I just realized that Macro himself replied. Thank you for this mutator. Anyways here's what I'd like to do next:

1. I set minimum level 1 and maximum 10.
2. Anything after level 6 spawns the same default weapon and I'd like to change that.
3. I downloaded IJC's weapon pack and got it installed successfully.
4. For example, I want a level 7 sharpshooter to spawn with a barrett by default when he joins.

My problem:
1. How do I accomplish this? Do I use the source code from Per Server Stats and add something like this to SRVetSharpshooter.uc?:

Code:
// Give Extra Items as Default
static function AddDefaultInventory(KFPlayerReplicationInfo KFPRI, Pawn P)
{
    // If Level 5, give them a  Lever Action Rifle
    if ( KFPRI.ClientVeteranSkillLevel == 5 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Winchester", GetCostScaling(KFPRI, class'DualDeaglePickup'));

    // If Level 6, give them a Crossbow
    if ( KFPRI.ClientVeteranSkillLevel [COLOR=Lime]==[/COLOR] 6 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFMod.Crossbow", GetCostScaling(KFPRI, class'CrossbowPickup'));

    // If Level 6, give them a Crossbow
    if ( KFPRI.ClientVeteranSkillLevel >= 7 )
        KFHumanPawn(P).CreateInventoryVeterancy("[COLOR=Yellow]How do I link to IJC's barret?[/COLOR]", GetCostScaling(KFPRI, class'[COLOR=Yellow]How do I link to the pickup?[/COLOR]'));

}



2. Do I create a separate mutator that does this?

3. Is there a mutator that can assign new weapons to new levels?
 
Upvote 0
Problem with perks saving on Linux

Problem with perks saving on Linux

Hello,

I'm moving Netsky's servers from Windows to Linux, I've still got the database running on a Windows dedi but when running the ServerPerksV4 mut on the Linux server it saves it in a different way than before.

This is what happens in the Data.ini now;

Windows (Windows server 2008) KF server:
[76561198032409363]
Netsky_Bashy=SPerksAddOn.Berserk,(all the stats here)

Linux (Ubuntu 10.04) KF server:
[72143635]
Netsky_Bashy=SPerksAddOn.Berserk,(all the stats here)

Parts in "bold" are different from playing on Linux/Windows.
Any help?

Thanks
 
Last edited:
Upvote 0
It challenged perk select bug fix.
It is a sample code.

fix.
1.Weapon bonus doesn't match when spawn.
2.Perk doesn't change when shop time.

KFPCServ.uc
Code:
before

function SendSelectedVeterancyToServer(optional bool bForceChange)

after

function SendSelectedVeterancyToServer(optional bool bForceChange)
{
	// Perk Select fix
	if( ServerStStats(SteamStatsAndAchievements)!=none )
		ServerStStats(SteamStatsAndAchievements).WaveEndSwitch();
}

ServerStStats.uc
Code:
[I]Class ServerStStats extends KFSteamStatsAndAchievements;

var ClientPerkRepLink Rep;
var StatsObject MyStatsObject;
var KFPlayerController PlayerOwner;
var ServerPerksMut MutatorOwner;
var bool bHasChanged,bStatsChecking,bStHasInit,bHadSwitchedVet,bSwitchIsOKNow,bStatsReadyNow;
[/I]// Perk Select fix (add)
var bool bHasChangedGameType;


before

function WaveEnded()
{
	if( SelectingPerk!=None )
	{
		bHadSwitchedVet = false;
		bSwitchIsOKNow = true;
		ServerSelectPerk(SelectingPerk);
		bSwitchIsOKNow = false;
	}
}



after

function WaveEnded()
{
	// Perk Select fix
	if( bHasChangedGameType )
	{
		bHasChangedGameType = false;
	}
	else
	{
		bHadSwitchedVet = false;
		bHasChangedGameType = false;
	}
}

function WaveEndSwitch()
{
	// Perk Select fix (add)
	if( SelectingPerk!=None )
	{
		bHadSwitchedVet = false;
		ServerSelectPerk(SelectingPerk);

		// Call from KFGameType flg
		// KFGameType -> (KFPlayerController)KFPCServ.SendSelectedVeterancyToServer
		bHasChangedGameType = true;
	}
}
 
  • Like
Reactions: krispyk and FluX
Upvote 0
It challenged perk select bug fix.
It is a sample code.

fix.
1.Weapon bonus doesn't match when spawn.
2.Perk doesn't change when shop time.

KFPCServ.uc
Code:
before
 
function SendSelectedVeterancyToServer(optional bool bForceChange)
 
after
 
function SendSelectedVeterancyToServer(optional bool bForceChange)
{
    // Perk Select fix
    if( ServerStStats(SteamStatsAndAchievements)!=none )
        ServerStStats(SteamStatsAndAchievements).WaveEndSwitch();
}

ServerStStats.uc
Code:
[I]Class ServerStStats extends KFSteamStatsAndAchievements;[/I]
 
[I]var ClientPerkRepLink Rep;[/I]
[I]var StatsObject MyStatsObject;[/I]
[I]var KFPlayerController PlayerOwner;[/I]
[I]var ServerPerksMut MutatorOwner;[/I]
[I]var bool bHasChanged,bStatsChecking,bStHasInit,bHadSwitchedVet,bSwitchIsOKNow,bStatsReadyNow;[/I]
// Perk Select fix (add)
var bool bHasChangedGameType;
 
 
before
 
function WaveEnded()
{
    if( SelectingPerk!=None )
    {
        bHadSwitchedVet = false;
        bSwitchIsOKNow = true;
        ServerSelectPerk(SelectingPerk);
        bSwitchIsOKNow = false;
    }
}
 
 
 
after
 
function WaveEnded()
{
    // Perk Select fix
    if( bHasChangedGameType )
    {
        bHasChangedGameType = false;
    }
    else
    {
        bHadSwitchedVet = false;
        bHasChangedGameType = false;
    }
}
 
function WaveEndSwitch()
{
    // Perk Select fix (add)
    if( SelectingPerk!=None )
    {
        bHadSwitchedVet = false;
        ServerSelectPerk(SelectingPerk);
 
        // Call from KFGameType flg
        // KFGameType -> (KFPlayerController)KFPCServ.SendSelectedVeterancyToServer
        bHasChangedGameType = true;
    }
}

Cheers, this was the next thing I was going to try fix myself.
 
Upvote 0
Anyone know if you can edit the perk leveling requirements on this mut? And I mean changing it to something entirely custom instead of "do this and that damage and kill this many stalkers"

Or if not, any idea where are these requirements specified in because I tried looking through the KFMod folder but couldnt find the original file.
 
Last edited:
Upvote 0
Anyone know if you can edit the perk leveling requirements on this mut? And I mean changing it to something entirely custom eg. "do 20000 damage with machete"?

Or if not, any idea where are these requirements specified in because I tried looking through the KFMod folder but couldnt find the original file.

What exactly do you mean? If you mean to get custom requirements for specific weapons etc, you'll have to make a custom weapon which will have the damage requirement level in the damage type for this custom weapon. It's a little fidly but very useful for a modded server as you can easily just replace the original weapon with the new custom weapon.

Im sorry if I got the wrong idea. If this is what you ment, I can offer my help if you want it :)
 
Upvote 0
Anyone know if you can edit the perk leveling requirements on this mut? And I mean changing it to something entirely custom eg. "do 20000 damage with machete"?

Or if not, any idea where are these requirements specified in because I tried looking through the KFMod folder but couldnt find the original file.

you need to make a supermachetepickup that says to use "supermachete" (thats what i'm calling it) which says supermachetefire does 6k damage.

so supermachetepickup extends machetepickup
supermachete extends machete
supermachetefire extends machetefire

so all you change on the "supers" is to say that they use each other.
they will use the same models/anim/sounds as the regular machete, just with more damage.

then you can tell the srvetberserker level 6 to spawn with the supermachete, or add it to the customshopmut.


there might be an easier way to do this, but this is how i've been doing my machineguns.
 
Upvote 0
What exactly do you mean? If you mean to get custom requirements for specific weapons etc, you'll have to make a custom weapon which will have the damage requirement level in the damage type for this custom weapon. It's a little fidly but very useful for a modded server as you can easily just replace the original weapon with the new custom weapon.

Im sorry if I got the wrong idea. If this is what you ment, I can offer my help if you want it :)

No no no no you all got me wrong. But I admit it was a little misleading question.

What I was talking about is the LEVELING REQUIREMENTS for perks, for example a commando needs to do some amount of damage with bullpup/ak/scar and kill stalkers. I want to make custom leveling requirements for custom perks. So imagine there was a perk focusing on machetes and he had to do 2000 points worth of damage on the specimens to get from level 0 to 1 and so forth.

I know how to make custom weapons thats not the problem.
 
Last edited:
Upvote 0
here are the leveling requirements for srvetberserker:

Code:
static function int GetPerkProgressInt( ClientPerkRepLink StatOther, out int FinalInt, byte CurLevel, byte ReqNum )
{
    switch( CurLevel )
    {
    case 0:
        FinalInt = 5000;
        break;
    case 1:
        FinalInt = 25000;
        break;
    case 2:
        FinalInt = 100000;
        break;
    case 3:
        FinalInt = 500000;
        break;
    case 4:
        FinalInt = 1500000;
        break;
    case 5:
        FinalInt = 3500000;
        break;
    case 6:
        FinalInt = 5500000;
        break;
    default:
        FinalInt = 5500000+GetDoubleScaling(CurLevel,500000);
    }
    return Min(StatOther.RMeleeDamageStat,FinalInt);
}

edit those numbers to change the leveling requirements, OR change in serverperksv4.ini the scale on which the levels are increasd (.1 = one tenth the requirements, lowest is .01)
 
Upvote 0
No no no no you all got me wrong. But I admit it was a little misleading question.

What I was talking about is the LEVELING REQUIREMENTS for perks, for example a commando needs to do some amount of damage with bullpup/ak/scar and kill stalkers. I want to make custom leveling requirements for custom perks. So imagine there was a perk focusing on machetes and he had to do 2000 points worth of damage on the specimens to get from level 0 to 1 and so forth.

I know how to make custom weapons thats not the problem.

Yeah I think you mislead me aswel :p

If you mean custom requirement as in, certain amount of damage with a machete. You will have to make a custom machete to have a custom damage type which works with the new requirement. If you look at ro_sauce's code from the post before, it has "RMeleeDamageStat". This is what levels up the requirement for berserker (which all berserker weapons hold inside the damage type) which tells what they will level.

Am I on the right lines yet or is ro_sauce correct?
 
Last edited:
Upvote 0