[help] altering kfscoreboard with headshot kills

  • 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/

mooarchanox

FNG / Fresh Meat
Aug 19, 2010
188
11
0
i'm trying to alter the scoreboard to something like this

EhOxt.jpg


but i can't seems to make to headshot count since i am really a noob coder :(
any suggestion on how to ? i intend to make it as a separate mutator ..

by the way this headshot count is suppose to be for all guns, but i would like to know how to for the sharpy only too...

currently i have these following:

ScoreBoard.uc

Code:
...
        // draw kills
        if( bDisplayWithKills )
        {
            Canvas.StrLen(KFPlayerReplicationInfo(GRI.PRIArray[i]).Kills, KillWidthX, YL);
            Canvas.SetPos(KillsXPos - 0.5 * KillWidthX, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
            Canvas.DrawText(KFPlayerReplicationInfo(GRI.PRIArray[i]).Kills, true);
        }
        
        // draw headshot kills
        Canvas.StrLen(SRPlayerReplicationInfo(GRI.PRIArray[i]).KilledHeadshot, KillWidthX, YL);
        Canvas.SetPos(KilledHeadshotXPos - 0.5 * KillWidthX, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
        Canvas.DrawText(SRPlayerReplicationInfo(GRI.PRIArray[i]).KilledHeadshot, true);
...
ScoreBoardMut.uc
Code:
class ScoreboardMut extends Mutator;

function PostBeginPlay()
{        
    if(SRGameType(level.game)==none)
    {
        //currentmap=GetURLMap(false);
        level.servertravel("?game=ACNXSCORE.SRGameType",true);
    }
}
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
    if( Controller(Other) !=None )
        Controller(Other).PlayerReplicationInfoClass = Class'SRPlayerReplicationInfo';
    return true;
}
...
SRPlayerReplicationInfo.uc
Code:
class SRPlayerReplicationInfo extends KFPlayerReplicationInfo;
var int KilledSirens;
var int KilledScrakes;
var int KilledFPs;
var int KilledPats;
var int KilledHusks;
var byte MaxPlayers;

var int KilledHeadshot;

replication
{
    // Things the server should send to the client.
    reliable if ( bNetDirty && (Role == Role_Authority) )
        KilledSirens,
        KilledScrakes,
        KilledFPs,
        KilledPats,
        KilledHusks,
        MaxPlayers;

        KilledHeadshot,
}
...
SRGameType.uc

Code:
...
function ScoreKill(Controller Killer, Controller Other)
{
   super.ScoreKill(Killer, Other);
}
simulated function Killed(Controller Killer, Controller Killed, Pawn KilledPawn, class<DamageType> damageType)
{

    local SRPlayerReplicationInfo KFPRI;
    
    Super.Killed(Killer,Killed,KilledPawn,DamageType);

    if((Killer != None) && Killer.bIsPlayer)
    {
        KFPRI = SRPlayerReplicationInfo(KFPlayerController(Killer).PlayerReplicationInfo);
        if(KilledPawn.IsA('ZombieSiren'))
            KFPRI.KilledSirens++;
        else if(KilledPawn.IsA('ZombieScrake'))
            KFPRI.KilledScrakes++;
        else if(KilledPawn.IsA('ZombieFleshpound'))
            KFPRI.KilledFPs++;
        else if(KilledPawn.IsA('ZombieHusk'))
            KFPRI.KilledHusks++;
        else if(KilledPawn.IsA('ZombieBoss'))
            KFPRI.KilledPats++;
        else
            log(KilledPawn.Class);
    }
}

defaultproperties
{
     ScoreBoardType="ACNXSCORE.ScoreBoard"
}
these are the stat i alter and will be put on the board later but for now i would like the headshot count ...
 
Last edited:

FluX

Grizzled Veteran
Oct 26, 2010
5,379
234
63
www.fluxiserver.co.uk
You need to specify the headshot itself. If you notice inside SRGameType.uc
you will see the replication data that will get checked for each of the kills which then are added to the custom scoreboard stats.

Im not too sure on how to check if the kill was a headshot exactly BUT I think you can easily make an if statement inside the scorekill function which can check for both headshots AND kills.
 

ro_sauce

FNG / Fresh Meat
Sep 26, 2007
3,134
329
0
bwhgaming.com
how would i make it so that something checks the kill count during "your squad survived"?
i'm making a fun reward for the person with the most kills.
 

FluX

Grizzled Veteran
Oct 26, 2010
5,379
234
63
www.fluxiserver.co.uk
how would i make it so that something checks the kill count during "your squad survived"?
i'm making a fun reward for the person with the most kills.
Erm im not entirely sure myself but can you make a check of if the match has been won, the person with the most kills, do this?
 

mooarchanox

FNG / Fresh Meat
Aug 19, 2010
188
11
0
Yup, i already know that i need to specify it in the SRGametype.uc, but the problem is what should i put in there :eek: !? anyone ... ?