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

[request] Mut to show damage

Dr_Mozg

Grizzled Veteran
May 1, 2012
117
4
Hey!
Maybe someone of you guys have already seen this thread, but there was no reaction=(
I think the idea is great and such a mut should be whitelisted (or at least greylisted), as it doesn't give any advantage, but it's really informative=)
If someone could make such a mutator, that shows damage you deal, like the kill count mut, many people would appreciate it=)
Thanks in advance!
 
Hey!
Maybe someone of you guys have already seen this thread, but there was no reaction=(
!

Huh? King Sumo already made the mutator and posted the code in that thread :/

I made a small change to make it display the damage on screen instead of logging it to a file.

Code:
Class DamageLogGameType extends KFGameType;
 
function int ReduceDamage(int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType)
{
    local int ReducedDamage;
 
    ReducedDamage = super.ReduceDamage( Damage, injured, instigatedBy, HitLocation, Momentum, DamageType );
 
    // log("DamageLog, injured:"@injured.GetHumanReadableName()@"instigatedBy:"@instigatedBy.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);
	
	instigatedBy.ClientMessage("injured:"@injured.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);

   return ReducedDamage;
}
 

Attachments

  • DamageLogGameTypeMut.zip
    2.1 KB · Views: 1
  • Like
Reactions: Dr_Mozg
Upvote 0
Huh? King Sumo already made the mutator and posted the code in that thread :/

I made a small change to make it display the damage on screen instead of logging it to a file.

Code:
Class DamageLogGameType extends KFGameType;
 
function int ReduceDamage(int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType)
{
    local int ReducedDamage;
 
    ReducedDamage = super.ReduceDamage( Damage, injured, instigatedBy, HitLocation, Momentum, DamageType );
 
    // log("DamageLog, injured:"@injured.GetHumanReadableName()@"instigatedBy:"@instigatedBy.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);
	
	instigatedBy.ClientMessage("injured:"@injured.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);

   return ReducedDamage;
}

Thanks a lot!
I've tried compiling a mutator with King sumo's code, but I couldn't see it in the mutator menu in the game=(
 
Upvote 0
Thanks a lot!
I've tried compiling a mutator with King sumo's code, but I couldn't see it in the mutator menu in the game=(

lol, I had the same problem. It took me a while to figure it out.


Code:
Class DamageLogGameTypeMut extends Mutator;

function PostBeginPlay()
{
	if(DamageLogGameType(Level.Game) == none)
		Level.ServerTravel("?game=DamageLogGameTypeMut.DamageLogGameType", true);
}

defaultproperties
{
    [B]GroupName="KFDamageLogGameTypeMut"[/B]
    FriendlyName="DamageLogGameTypeMut"
    Description="Damage Messages"
}


GroupName needs to have KF at the start to make it show up in the mutators list.
 
Upvote 0
Huh? King Sumo already made the mutator and posted the code in that thread :/

I made a small change to make it display the damage on screen instead of logging it to a file.

Code:
Class DamageLogGameType extends KFGameType;
 
function int ReduceDamage(int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType)
{
    local int ReducedDamage;
 
    ReducedDamage = super.ReduceDamage( Damage, injured, instigatedBy, HitLocation, Momentum, DamageType );
 
    // log("DamageLog, injured:"@injured.GetHumanReadableName()@"instigatedBy:"@instigatedBy.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);
 
    instigatedBy.ClientMessage("injured:"@injured.GetHumanReadableName()@"damage:"@ReducedDamage@"DamageType:"@DamageType);
 
   return ReducedDamage;
}
That is probably why I never took consideration to it as it only logged it to the players/servers log which wasn't what I was looking for. Cheers for this as this will help me with my balancing issues for my server.
 
Upvote 0
how to make that text displays in centre? :confused:
and only for me i mean others cant see that damage text they just see their own damages text..?
any idea? :confused:
Thanks :eek:

Edit:

i want from it to displays the text like how dose kfserverads do in the centre of screen when we put # before the line, but for only the player him self who dose the damage and the others cant see this text which has been made by his damage they just see their owns damage text and none can see the others damage text
any help?
i want to add that to this mut :)
here is some of the kfserverads mut source code
Code:
///////////////////////////////////////////////////////////////////////////////
// filename:    ServerAdsKF.uc
// version:     101
// author:      DeeZNutZ <[email protected]>
// perpose:     displaying messages (advertisements) in every players console.
///////////////////////////////////////////////////////////////////////////////

class ServerAdsKF extends Info config;

const VERSION   = "101";
const MAXLINES  = 25;
const DEBUG     = false;

var bool    bInitialized;
var int     iCurPos;
var int     nLines;

// config options
var globalconfig bool   bEnabled;
var globalconfig float  fDelay;           // delay between a message (seconds)
var globalconfig string sLines[MAXLINES]; // the lines
var globalconfig int    iGroupSize;       // number of lines to show at one
var globalconfig int    iAdType;          // the way to display lines
var globalconfig bool   bWrapAround;      // at the end of the list, start at the beginning
var globalconfig int    iAdminMsgDuration;// seconds that an "admin" message will stay visible
var globalconfig color  cAdminMsgColor;   // color of the admin messages
//  iAdType - description
//  0         display iGroupSize number at the time
//  1         display iGroupSize number of _random_ lines, bWrapAround has no effect
//  2         display iGroupSize number at the time, start at a random position
var globalconfig bool   bUseURL;          // get lines from www
var globalconfig string sURLHost;         // hostname
var globalconfig int    iURLPort;         // webserver port, default 80
var globalconfig string sURLRequest;      // file to request

// initialise this serveractor
function PostBeginPlay()
{
  local int i;
  local string tmp[MAXLINES];

	if (!bInitialized)
  {
    nLines = 0;
    bInitialized = true;
    log("[~] Starting ServerAdsKF version: "$VERSION);
    if (DEBUG) log("[~] * DEBUG compiled *");
    log("[~] DeeZNutZ - [email protected]");
    log("[~] BadStreak - http://www.badstreak.com");
    if (bUseURL) getLinesFromWeb();
    // clean up list
    for (i = 0; i < MAXLINES; i++)
    {
      if (sLines[i] != "") 
      {
        tmp[nLines] = sLines[i];
        nLines++;
      }
    }
    for (i = 0; i < MAXLINES; i++)
    {
      sLines[i] = tmp[i];
    }
    StaticSaveConfig();
    SaveConfig();
    log("[~] There are "$nLines$" lines in the list");
    iCurPos = 0;
    SetTimer(fDelay,true);
  }
}

// update the timer with a new value
function UpdateTimer()
{
  SetTimer(fDelay,true);
}

// broadcast the message
event Timer()
{
  local int i;

  if (!bEnabled) return; // disabled, so return
  if ((iCurPos >= nLines) && (bWrapAround == false)) return;

  switch (iAdType)
  {
    case 0: for (i = 0; i < iGroupSize; i++)
            {
              if (iCurPos >= nLines)
              {
                if (bWrapAround) iCurPos = 0;
                else return;
              }
              BroadcastAd(sLines[iCurPos]);
              iCurPos++;
            }
            break;
    case 1: for (i = 0; i < iGroupSize; i++)
            {
              BroadcastAd(sLines[rand(nLines)]);
            }
            iCurPos = 0; // to make sure bWrapAround has no effect
            break;
    case 2: iCurPos = rand(nLines); // begin at a random position
            for (i = 0; i < iGroupSize; i++)
            {
              if (iCurPos >= nLines)
              {
                if (bWrapAround) iCurPos = 0;
                else return;
              }
              BroadcastAd(sLines[iCurPos]);
              iCurPos++;
            }
            iCurPos = 0; // to make sure bWrapAround has no effect
            break;
  } 
}


// send message to players
event BroadcastAd( coerce string Msg)
{  
  local controller C;

	// center print admin messages which start with #
	if (left(Msg,1) == "#" )
	{
		Msg = right(Msg,len(Msg)-1);
		for( C=Level.ControllerList; C!=None; C=C.nextController )
    {
			if( C.IsA('PlayerController') )
			{
				PlayerController(C).ClearProgressMessages();
				PlayerController(C).SetProgressTime(iAdminMsgDuration);
				PlayerController(C).SetProgressMessage(0, Msg, cAdminMsgColor);
        //class'Canvas'.Static.MakeColor(255,255,255));
			}
    }
    if (DEBUG) log("[D] ServerAdsKF admin line: "$Msg);
		return;
	}
  Level.Game.Broadcast(None, Msg);
  if (DEBUG) log("[D] ServerAdsKF line: "$Msg);
}

function getLinesFromWeb()
{
  local WebDownload wdl;
  if (DEBUG) log("[D] ServerAdsKF Download lines from the web");
  wdl = Spawn( class 'ServerAdsKF.WebDownload' );
  wdl.sHostname = sURLHost;
  wdl.iPort = iURLPort;
  wdl.sRequest = sURLRequest;
  wdl.sase = Self;
  wdl.GetLines();
}

defaultproperties
{
     bEnabled=True
     fDelay=300.000000
     iGroupSize=1
     bWrapAround=True
     iAdminMsgDuration=4
     cAdminMsgColor=(G=255,R=255,A=127)
     sURLHost="localhost"
     iURLPort=80
     sURLRequest="/serverads.txt"
}
idk how to add that centre screen thing to that mut.. any help? :confused:
sorry i am noob and i can hardly understand any codes :eek:
Thanks.. :)
 
Last edited:
Upvote 0
Woah stop spamming like that. This will get you no where and will stop us from helpping you at all. To put it straight, that mutator has nothing to do with setting it to the middle. Please read as what it says is, if you put the message to a Admin Message (where it is centered in the middle of the screen), put a # infront to do that. They are global messages so that wont work at all.

I think it's something to do with the HUD but im not sure where and how to make it. It's something to do with the player's view (duh but listen) where you see all the perks so pretty much the overlay on the screen.
 
Upvote 0
BUMP!!
i really need help with this guys.. -_-

Looks like your ticket expired with this comment.. shame

hemishelp.png
 
  • Like
Reactions: tehmadcap
Upvote 0