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

Code [Help] How to add Vet_type to damage?

ro_sauce

Grizzled Veteran
Sep 26, 2007
3,134
329
bwhgaming.com
so i'm trying to make fieldmedics get equal damage on FF, but their armour keeps absorbing it all:

Code:
class ffRules extends GameRules;

function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
    if ( injured.isa('kfhumanpawn') && instigatedby.isa('kfhumanpawn') && injured!=instigatedby)
    {
          instigatedby.takedamage((damage * 2.5), instigatedBy, hitlocation, momentum, damageType);
      damage = damage;
      return Damage;
    }
    //if person is fieldmedic, do 10x moredamage to get through medic armour
    else if ( injured.isa('kfhumanpawn') && instigatedby.isa('kfhumanpawn(KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill == Class'SRVetFieldMedic')') && injured!=instigatedby)
    {
          instigatedby.takedamage((damage * 125), instigatedBy, hitlocation, momentum, damageType);
        damage = damage;
        return Damage;
    }
    
}
and i dont really know how to add the clientvetskill to this correctly.

or is there a way to send the FF damage directly to health? bypass the armour (shieldabsorb)?
 
Last edited:
\ffrules.uc(7) : Error, Unrecognized member 'FriendlyFireScale' in class 'GameInfo'

also tried (and failed):
Code:
instigatedby.health -= damage*Level.Game.unrealmpgameinfo.deathmatch.teamgame.xteamgame.invasion.kfgametype.FriendlyFireScale;

-edit:
ok i got it with this: (only tested with a kfhumanpawn bot though)
Code:
 if ( injured.isa('kfhumanpawn') && instigatedby.isa('kfhumanpawn') && injured!=instigatedby)
 {
   instigatedby.Health = (instigatedby.Health - Damage);
   injured.Health = (injured.Health - Damage);
   damage = 0;
   return Damage;
 }
totally ignores perk stuff and sends whatever damage recieved to the inflictor also.
 
Last edited:
Upvote 0
how about add this outside your braces? its supposed to be the hack for the Siren damage, which ignores your armor and deals damage direct --EDIT: this is taken from KFPawn which contains the damage methods you might want to take a look at
Code:
if (DamageType.default.DamageOverlayMaterial != None)
SetOverlayMaterial( DamageType.default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, false );

maybe call TakeDamage() or something after this
 
Last edited:
Upvote 0
here's the progress so far:

Code:
class ffRules extends GameRules;

function int NetDamage( int OriginalDamage, int Damage, pawn injured,  pawn instigatedBy, vector HitLocation, out vector Momentum,  class<DamageType> DamageType )
{
local int ArmorDamage;
local int HPDamage;

if ( injured.isa('kfhumanpawn') && instigatedby.isa('kfhumanpawn') && injured!=instigatedby)
{
armordamage = (Damage * TeamGame(Level.Game).FriendlyFireScale) * 0.7;
hpdamage = (Damage * TeamGame(Level.Game).FriendlyFireScale);

instigatedby.Health -= HPDamage;
injured.Health -= HPDamage;

if ((instigatedby.ShieldStrength - ArmorDamage) <= 0) {
instigatedby.ShieldStrength = 0;
}
else {
instigatedby.ShieldStrength -= ArmorDamage;
}

if (injured.shieldStrength - (Damage * TeamGame(Level.Game).FriendlyFireScale) <= 0.0) {
injured.shieldStrength = 0;
}
else {
injured.ShieldStrength -= ArmorDamage;
}


damage = 0;
return Damage;
}
}

defaultproperties
{
}
 
Upvote 0