Score Announcer Mutator

Search, find and discuss about Mutators!
User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Score Announcer Mutator

Post by itsbowseryt » Fri Jan 08, 2016 2:53 pm

Hello everyone. I am searching for an Announcer Mutator that announce the score like "your're a tied for the lead", "you lost the lead", "you have taken the lead". So please help me find a good one. Any help will be apreciated :mrgreen:
the way it's meant to be played
Image
Image

SC]-[WARTZ_{HoF}
Adept
Posts: 425
Joined: Tue Feb 21, 2012 7:29 pm

Re: Score Announcer Mutator

Post by SC]-[WARTZ_{HoF} » Fri Jan 08, 2016 5:38 pm

If I'm right I think this is what you are looking for.
http://unrealtournament.99.free.fr/utfi ... edback.zip
Image
Image
Image

User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Re: Score Announcer Mutator

Post by itsbowseryt » Fri Jan 08, 2016 8:28 pm

SC]-[WARTZ_{HoF} wrote:If I'm right I think this is what you are looking for.
http://unrealtournament.99.free.fr/utfi ... edback.zip
Thank you so much!
the way it's meant to be played
Image
Image

User avatar
UTPe
Masterful
Posts: 510
Joined: Sun Jul 12, 2009 7:10 pm
Personal rank: Dude
Location: Trieste, Italy

Re: Score Announcer Mutator

Post by UTPe » Sat Jan 09, 2016 9:47 am

Hi itsbowseryt,
there's also an updated version of the mutator (v2.1).
time ago, I remember people said original version had some problems but I never tested this new version, take a look at it.

cheers
You do not have the required permissions to view the files attached to this post.
Personal map database: http://ut99maps.gamezoo.org

"These are the days that we will return to one day in the future only in memories." (The Midnight)

User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA

Re: Score Announcer Mutator

Post by Chamberly » Sat Jan 09, 2016 10:52 am

Lol remind me of QAnnouncerNoLog... but it doesn't seem to do too well with newnet as it is broken in demo replay.
Image
Image
Image Edit: Why does my sig not work anymore?

JackGriffin
Godlike
Posts: 3767
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Score Announcer Mutator

Post by JackGriffin » Sat Jan 09, 2016 12:46 pm

This is pretty easy to add to your existing work too. Here's how to use it within your existing modding...

Import exec lines, replace with whatever countdown sound you want. I used a nice feminine one in the RedeemerMania source if you want something different but clean and clear.

Code: Select all

#exec AUDIO IMPORT FILE="Sounds\QAFOneFrag.wav" NAME="QAOneFrag" GROUP="Announcer"
#exec AUDIO IMPORT FILE="Sounds\QAFTwoFrags.wav" NAME="QATwoFrags" GROUP="Announcer"
#exec AUDIO IMPORT FILE="Sounds\QAFThreeFrags.wav" NAME="QAThreeFrags" GROUP="Announcer"
#exec AUDIO IMPORT FILE="Sounds\QAFTakenLead.wav" NAME="QATakenLead" GROUP="Announcer"
#exec AUDIO IMPORT FILE="Sounds\QAFTiedLead.wav" NAME="QATiedLead" GROUP="Announcer"
#exec AUDIO IMPORT FILE="Sounds\QAFLostLead.wav" NAME="QALostLead" GROUP="Announcer"
Your variables

Code: Select all

var Pawn Leaders[32], LastLeaders[32], Player[32];
var int  numLeaders, numLastLeaders, numPawns;
var int	fragsLeft;
var int numLastPlayers, numLastSpectators;
Add this into post

Code: Select all

function PostBeginPlay()
{
	numLastPlayers = Level.Game.NumPlayers;
   numLastSpectators = Level.Game.NumSpectators;
   SetTimer(0.1, True);
}
Here's the timer function

Code: Select all

function Timer()
{
   local Pawn P;

   Super.Timer();
   if ((Level.Game.NumPlayers != numLastPlayers) || (Level.Game.NumSpectators > numLastSpectators))
      announce();

   numLastPlayers = Level.Game.NumPlayers;
   numLastSpectators = Level.Game.NumSpectators;
}
Tack this section into your class at the end and don't change anything:

Code: Select all

function bool isLeader(Pawn P)
{
   local int i;
   for (i = 0; i < numLeaders; i++)
   {
      if (P == Leaders[i])
      {
	 return True;
      }
   }
   return False;
}

function bool wasLeader(Pawn P)
{
   local int i;
   for (i = 0; i < numLastLeaders; i++)
   {
      if (P == LastLeaders[i])
      {
	 return True;
      }
   }
   return False;
}

function bool addPawnToList(Pawn P)
{
   local int i;
   for (i = 0; i < numPawns; i++)
   {
      if (Player[i] == P)
      {
	 return False;
      }
   }
   Player[i] = P;
   numPawns++;
   return True;
}

function announce()
{
   local Pawn P;
   local float maxScore;
   local int i, j;
   local PlayerPawn PP;
   local TournamentGameReplicationInfo TGRI;

   if (Level.Game.bTeamGame)
   {
      return;
   }

   maxScore = -99999;
   numLeaders = 0;
   PP = None;

   for(P = Level.Pawnlist; P != None; P = P.Nextpawn)
   {
      if ((Bot(P) != None || PlayerPawn(P) != None) && P.PlayerReplicationInfo != None)
      {
         if (P.PlayerReplicationInfo.Score > maxScore && !P.IsA('Spectator'))
         {
	    maxScore = P.PlayerReplicationInfo.Score;
	    numLeaders = 1;
	    Leaders[numLeaders - 1] = P;
         }
         else if (P.PlayerReplicationInfo.Score == maxScore && !P.IsA('Spectator'))
         {
	    numLeaders++;
	    Leaders[numLeaders - 1] = P;
         }
         if (PP == None && PlayerPawn(P) != None)
	    PP = PlayerPawn(P);
      }
   }
   if ((numLeaders == 1) && ((numLastLeaders > 1) || ((numLastLeaders == 1) && !wasLeader(leaders[0]))) )
   {
      if (PlayerPawn(Leaders[0]) != None)
      {
         PlayerPawn(Leaders[0]).ClientPlaySound(Sound'QATakenLead', False);
      }
      for (i = 0; i < numLastLeaders; i++)
      {
         if ( (PlayerPawn(LastLeaders[i]) != None) && (LastLeaders[i] != Leaders[0]) )
         {
            PlayerPawn(LastLeaders[i]).ClientPlaySound(Sound'QALostLead', False);
	 }
      }
   }
   else if (numLeaders > 1)
   {
      for (i = 0; i < numLeaders; i++)
      {
         if ((PlayerPawn(Leaders[i]) != None) && (((numLastLeaders == 1) && (wasLeader(Leaders[i]))) || (!wasLeader(Leaders[i]))))
         {
	    PlayerPawn(Leaders[i]).ClientPlaySound(Sound'QATiedLead', False);
	 }
      }
      for (i = 0; i < numLastLeaders; i++)
      {
         if ( !(isLeader(lastLeaders[i])) && (PlayerPawn(lastLeaders[i]) != None) )
	 {
	    PlayerPawn(lastLeaders[i]).ClientPlaySound(Sound'QALostLead', False);
	 }
      }
   }
   for (i = 0; i < numLeaders; i++)
   {
      LastLeaders[i] = Leaders[i];
   }
   numLastLeaders = numLeaders;
   if ( (PP != None) && (Level.Game.GameName != "Last Man Standing") )
   {
      TGRI = TournamentGameReplicationInfo(PP.GameReplicationInfo);
      switch (TGRI.FragLimit - maxScore)
      {
         case 3:
	 if (fragsLeft > 3)
	 {
	    foreach AllActors( class 'PlayerPawn', PP )
            {
	       PP.ClientPlaySound(Sound'QAThreeFrags', False);
	    }
            fragsLeft = 3;
	 }
         break;
         case 2:
	 if (fragsLeft > 2)
         {
            foreach AllActors( class 'PlayerPawn', PP )
            {
	       PP.ClientPlaySound(Sound'QATwoFrags', False);
	    }
            fragsLeft = 2;
         }
         break;
         case 1:
         if (fragsLeft > 1)
         {
            foreach AllActors( class 'PlayerPawn', PP )
            {
               PP.ClientPlaySound(Sound'QAOneFrag', False);
	    }
            fragsLeft = 1;
         }
	 break;
         default:
	 break;
      }
   }
}

function ScoreKill(Pawn Killer, Pawn Other)
{
   local int i;

   i = 0;
   while (TRUE)
   {
      if ( NextMutator != None )
      {
	 NextMutator.ScoreKill(Killer, Other);
      }
      else break;
      if (i > 15)
         break;

      i++;
   }
   announce();

   if ( NextMutator != None )
   {
      NextMutator.ScoreKill(Killer, Other);
   }
}
and finally in defprops:

Code: Select all

defaultproperties
{
   fragsLeft=4
}
It's that simple.
So long, and thanks for all the fish

User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Re: Score Announcer Mutator

Post by itsbowseryt » Sat Jan 09, 2016 1:32 pm

Thanks all for help!
the way it's meant to be played
Image
Image

User avatar
sektor2111
Godlike
Posts: 5871
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Score Announcer Mutator

Post by sektor2111 » Sat Jan 09, 2016 5:37 pm

UTPe wrote:Hi itsbowseryt,
there's also an updated version of the mutator (v2.1).
time ago, I remember people said original version had some problems but I never tested this new version, take a look at it.
No worries, if you have MH intentions with this, then you can forget it. In 2011 were still issues blabbering with "bIsPlayer && PlayerReplicationInfo.Whatever" lousy granted into the Lord Accessed None the UT's father.

User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Re: Score Announcer Mutator

Post by itsbowseryt » Sun Jan 10, 2016 12:45 pm

sektor2111 wrote:
UTPe wrote:Hi itsbowseryt,
there's also an updated version of the mutator (v2.1).
time ago, I remember people said original version had some problems but I never tested this new version, take a look at it.
No worries, if you have MH intentions with this, then you can forget it. In 2011 were still issues blabbering with "bIsPlayer && PlayerReplicationInfo.Whatever" lousy granted into the Lord Accessed None the UT's father.
I keep getting that error. The accesed none error :nonono:
the way it's meant to be played
Image
Image

JackGriffin
Godlike
Posts: 3767
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Score Announcer Mutator

Post by JackGriffin » Sun Jan 10, 2016 3:00 pm

Attach it here and a couple of the error log lines. I'll fix it for you.
So long, and thanks for all the fish

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Score Announcer Mutator

Post by Spectra » Mon Jan 11, 2016 5:13 am

What about UTToolBox??

User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA

Re: Score Announcer Mutator

Post by Chamberly » Mon Jan 11, 2016 9:58 am

I don't think I ever heard of UTToolBox, what is that?
Image
Image
Image Edit: Why does my sig not work anymore?

User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Re: Score Announcer Mutator

Post by itsbowseryt » Mon Jan 11, 2016 3:08 pm

Chamberly wrote:I don't think I ever heard of UTToolBox, what is that?
Chamberly, i think this is, but i am not so sure if it is what he means.
-http://ut99.org/viewtopic.php?f=7&t=5687
the way it's meant to be played
Image
Image

User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA

Re: Score Announcer Mutator

Post by Chamberly » Mon Jan 11, 2016 3:16 pm

Well if he is talking about that, then that is completely strange as it don't have anything to do with the original subject of this thread. :loool:
Image
Image
Image Edit: Why does my sig not work anymore?

User avatar
itsbowseryt
Novice
Posts: 21
Joined: Tue Dec 15, 2015 1:59 pm
Personal rank: YouTuber
Location: Romania

Re: Score Announcer Mutator

Post by itsbowseryt » Mon Jan 11, 2016 3:22 pm

Chamberly wrote:Well if he is talking about that, then that is completely strange as it don't have anything to do with the original subject of this thread. :loool:
Ok
the way it's meant to be played
Image
Image