This is a test. Test! Consider yourself tested.

[UT] DamageType Redirection?

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Draco Nihil
Skaarj Lord Skaarj Lord
Posts: 197
Joined: 06 Jun 2012, 21:18
Location: Independence, Kansas
Contact:

Subject: [UT] DamageType Redirection?

Post Posted: 14 May 2013, 09:22

Is it possible with UT99 Mutator's to redirect DamageType so that it is always 'All'?

Because I want to make a mutator that makes it so it's always possible to gib someone no matter what weapon you use.

EDIT: I see there is no way to make this work "properly" but I managed to hack it in anyways

Code: Select all

//=============================================================================
// AlwaysGibMutator.
// You always have a chance to gibb someone no matter what type of damage you cause to them.
//=============================================================================
class AlwaysGibMutator expands Mutator;

var   transient   private   Pawn   LastHitCheck;

event PreBeginPlay()
{
   LastHitCheck = None;
}

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
   if( Other.IsA('Weapon') )
   {
      Weapon(Other).MyDamageType = 'All';
      Weapon(Other).AltDamageTYpe = 'All';
   }

   return true;
}

function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation,
                  out Vector Momentum, name DamageType)
{
   local int   Dam;
   local   vector   Mom;

   if( (Victim != None) && (Victim != LastHitCheck) )
   {
      LastHitCheck = Victim;
      Dam = ActualDamage;
      Mom = Momentum;
      ActualDamage = 0;
      Momentum = vect(0.0,0.0,0.0);
      DamageType = 'All';
      Victim.TakeDamage( Dam, InstigatedBy, HitLocation, Mom, 'All');
      LastHitCheck = None;
   }

   if ( NextDamageMutator != None )
      NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, 'All' );
}
“I am the dragon without a name...”

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: [UT] DamageType Redirection?

Post Posted: 14 May 2013, 18:45

MoreGore has an AlwaysGib option. It basically just ignores the function bool Gibbed() and immediately calls SpawnGibbedCarcass(). It will actually call this multiple times, depending on the gore level, which is why you can crank it up.

[Edit] Actually I think bAlwaysGib was in UT3's Gibalicious, but not in stock MoreGore for UT, and I added it to EXUMoreGore myself. This is basically all you need:

Code: Select all

function ScoreKill(Pawn Killer, Pawn Other)
{
   local int i;
   
   if( bAlwaysGib )
   {
      for( i=0; i<goreLevel; i++ )
         Other.SpawnGibbedCarcass();   
   }
   //check whether victim is at gib status
   else if( (Other.Health < -80) || ((Other.Health < -40) && (Other.FRand() < 0.6)) )
   {
      //Generate the desired amount of mess
      for( i=0; i<goreLevel; i++ )
         Other.SpawnGibbedCarcass();   
   }
   
   //Call next mutator down the line
   if( NextMutator!=None )
      NextMutator.ScoreKill(Killer, Other);
}
Image

User avatar Draco Nihil
Skaarj Lord Skaarj Lord
Posts: 197
Joined: 06 Jun 2012, 21:18
Location: Independence, Kansas
Contact:

Subject: Re: [UT] DamageType Redirection?

Post Posted: 14 May 2013, 23:42

Oh I don't want people to always gib on death. I want them to always gib when overkilled on any weapon.

Nothing more hilarious when you cause someone to blow up with the sniper rifle, because they had too low of health.

Basically I want to recreate how Quake just didn't give a flying damn about what type of damage you inflict, if you inflicted overkill on anything it results in gibbing.
“I am the dragon without a name...”

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: [UT] DamageType Redirection?

Post Posted: 16 May 2013, 04:27

This already happens, but it's based on damage dealt and mass of the pawn. Define "overkill" for your purposes and we'll have a better idea of what you need to do. It sounds like you need some kind of override for the Gibbed() function.
Image

User avatar Draco Nihil
Skaarj Lord Skaarj Lord
Posts: 197
Joined: 06 Jun 2012, 21:18
Location: Independence, Kansas
Contact:

Subject: Re: [UT] DamageType Redirection?

Post Posted: 16 May 2013, 16:51

It doesn't happen if the DamageType is either 'shot' or 'decapitated'.

This mutator prevents that from happening so even enforcers can cause gibbing if you're resourceful enough.
“I am the dragon without a name...”


Who is online

Users browsing this forum: No registered users and 53 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited