Page 1 of 2

Score Announcer Mutator

Posted: Fri Jan 08, 2016 2:53 pm
by itsbowseryt
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:

Re: Score Announcer Mutator

Posted: Fri Jan 08, 2016 5:38 pm
by SC]-[WARTZ_{HoF}
If I'm right I think this is what you are looking for.
http://unrealtournament.99.free.fr/utfi ... edback.zip

Re: Score Announcer Mutator

Posted: Fri Jan 08, 2016 8:28 pm
by itsbowseryt
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!

Re: Score Announcer Mutator

Posted: Sat Jan 09, 2016 9:47 am
by UTPe
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

Re: Score Announcer Mutator

Posted: Sat Jan 09, 2016 10:52 am
by Chamberly
Lol remind me of QAnnouncerNoLog... but it doesn't seem to do too well with newnet as it is broken in demo replay.

Re: Score Announcer Mutator

Posted: Sat Jan 09, 2016 12:46 pm
by JackGriffin
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.

Re: Score Announcer Mutator

Posted: Sat Jan 09, 2016 1:32 pm
by itsbowseryt
Thanks all for help!

Re: Score Announcer Mutator

Posted: Sat Jan 09, 2016 5:37 pm
by sektor2111
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.

Re: Score Announcer Mutator

Posted: Sun Jan 10, 2016 12:45 pm
by itsbowseryt
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:

Re: Score Announcer Mutator

Posted: Sun Jan 10, 2016 3:00 pm
by JackGriffin
Attach it here and a couple of the error log lines. I'll fix it for you.

Re: Score Announcer Mutator

Posted: Mon Jan 11, 2016 5:13 am
by Spectra
What about UTToolBox??

Re: Score Announcer Mutator

Posted: Mon Jan 11, 2016 9:58 am
by Chamberly
I don't think I ever heard of UTToolBox, what is that?

Re: Score Announcer Mutator

Posted: Mon Jan 11, 2016 3:08 pm
by itsbowseryt
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

Re: Score Announcer Mutator

Posted: Mon Jan 11, 2016 3:16 pm
by Chamberly
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:

Re: Score Announcer Mutator

Posted: Mon Jan 11, 2016 3:22 pm
by itsbowseryt
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