Question - counting pawnkills off?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

bima

It Is I
May 17, 2010
1
0
0
Hello i am making some simpel levels for some people at work.(we kill ourselfs in the lunchbreak)
I like to put some pawn's in a level to make the smallest places even smaller. :lol:
Problem is that some people are winning(on points) by killing pawn's.
How can i configure a pawn that if someone kills it, He does not get any point's.
 

GreatEmerald

Khnumhotep
Jan 20, 2008
4,042
1
0
Lithuania
Hmm, looking at the code it seems that it might be a problem... Pawns have the bIsPlayer flag set to False; this code (from Team Deathmatch):
Code:
function ScoreKill(pawn Killer, pawn Other)
{
    if ( (Killer == None) || (Killer == Other) || !Other.bIsPlayer || !Killer.bIsPlayer 
        || (Killer.PlayerReplicationInfo.Team != Other.PlayerReplicationInfo.Team) )
        Super.ScoreKill(Killer, Other);
<...>
}
checks if what you killed is a player, and if not, it goes here:
Code:
function ScoreKill(pawn Killer, pawn Other)
{
    Other.DieCount++;
    if( (killer == Other) || (killer == None) )
        Other.PlayerReplicationInfo.Score -= 1;
    else if ( killer != None )
    {
        killer.killCount++;
        if ( killer.PlayerReplicationInfo != None )
            killer.PlayerReplicationInfo.Score += 1;
    }

    BaseMutator.ScoreKill(Killer, Other);
}
This code adds the kill to the player's score. It also gets called in DeathMatch for every kill.
What you could do is create a mutator and in its ScoreKill() function remove one point from the player's score if that pawn had the bIsPlayer flag set to False (or if it's a subclass of ScriptedPawn). That still leaves one problem though - a player that needs one frag to win will win even if he kills a pawn in the game. I'd think you could use HandleEndGame() to deal with this problem, though.
 
Nov 4, 2001
2,196
0
0
36
The Kitchen
Monsterspawn I'm pretty sure allows you to disable pawn frags being counted, and by default, Monsterspawn's versions of the stock Unreal pawns will attack bots, too.

http://forums.beyondunreal.com/showthread.php?t=147823

[Edit] In the .ini, at the bottom, you see this:

UseUTMonsterspawnScoring=False
UTScoreMonstersHealth100=1
UTScoreMonstersHealth101to500=2
UTScoreMonstersHealth501to1000=3
UTScoreMonstersHealth1001to1500=4
UTScoreMonstersHealth1501to2000=5
UTScoreMonstersHealthOver2000=6
UTScoreMonsterBossBonus=5
UTScoreKillingFriemdliesLOSS=5

According to the readme, leaving the UT Scoring option False (default) causes pawns to not be counted, but if that doesn't work, try making everything 0 and setting UT scoring to True. Theoretically that should override any score value you get from killing a monster.
 
Last edited: