UE1 - UT Playing Sounds

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

Sterbehilfe

New Member
Oct 13, 2010
1
0
0
Hey,
I'm a beginner in Unrealcoding and wanted to ask why my Mutator doesnt do anything. It should just play the Sound "3kills" and a Player gets 3 Kills in a Row.

Code:
//=============================================================================
//  First & Senseless Mutator.
//=============================================================================

class Mutator123 extends Mutator;

#EXEC AUDIO IMPORT FILE=Sounds\3kills.wav NAME=3kills  PACKAGE=Mutator123

var Sound Serialkiller;

function SpreeRanking(Pawn Killer, Pawn Other)
{
	local PlayerPawn PP;
	local Pawn P;
	//local sound Serialkiller;
	
	Serialkiller = Sound'Mutator123.3kills';
	//Serialkiller = Sound.3kills;
	
	PP = PlayerPawn(Killer);

	if ( Killer.Spree == 3 )
	{
		for ( P=Level.PawnList; P!=None; P=P.NextPawn )
			{
			playerpawn(p).ClientPlaySound(Serialkiller);
			}
                BroadcastMessage(PP.PlayerReplicationInfo.PlayerName$" is a Serial Killer!", True, 'CriticalEvent');
       }		
}

defaultproperties {
	 Serialkiller=Sound'Mutator123.3kills'; 
}

The compiler says it's fine (which was hard work for me :mad:) .. but it still doesnt work
 

.:..:

New Member
Apr 11, 2006
61
0
0
Finland
If this is UnrealTournament, I would recommend you use function ScoreKill (as function 'SpreeRanking' does not exist in mutator thus will never get called).
Also I would recommend that you use localized message (LocalMessage) instead of BroadcastMessage + ClientPlaySound.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Also keep in mind when overriding functions to always call the Super version so your mutator doesn't break the chain. (Mutators forwards calls to the next mutator in the chain, only the very first is notified by the game directly.)
 
Apr 11, 2006
738
0
16
Also keep in mind what a "Spree" is defined as in the game.
Sprees are sequences of 5 kills during which the player does not die.

A "MultiKill" is a series of kills within a short time frame. From what you say you want, MultiKill is probably the more appropriate thing to be looking at.