Page 1 of 1

Simple code request

Posted: 22 Feb 2018, 22:21
by Lightning Hunter
This should (hopefully) be really simple. I just want to modify my own botpack.u (offline use only) so the bots deal less damage with the minigun (only for bots; not humans). This is the part of the code that I believe should be modified:

Code: Select all

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
   local int rndDam;

   if (Other == Level)
      Spawn(class'UT_LightWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
   else if ( (Other!=self) && (Other!=Owner) && (Other != None) )
   {
      if ( !Other.bIsPawn && !Other.IsA('Carcass') )
         spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9);
      else
         Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);

      if ( Other.IsA('Bot') && (FRand() < 0.2) )
         Pawn(Other).WarnTarget(Pawn(Owner), 500, X);
      rndDam = 9 + Rand(6);
      if ( FRand() < 0.2 )
         X *= 2.5;
      Other.TakeDamage(rndDam, Pawn(Owner), HitLocation, rndDam*500.0*X, MyDamageType);
   }
}


The ' rndDam = 9 + Rand(6); ' line is what I found changes the minigun damage, but I could not make this change apply to bots only. I'm sure someone knows how to do this!

Re: Simple code request

Posted: 23 Feb 2018, 00:56
by AlCapowned
I think something like this would work:

Code: Select all

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
   local int rndDam;

   if (Other == Level)
      Spawn(class'UT_LightWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
   else if ( (Other!=self) && (Other!=Owner) && (Other != None) )
   {
      if ( !Other.bIsPawn && !Other.IsA('Carcass') )
         spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9);
      else
         Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);

      if ( Other.IsA('Bot') && (FRand() < 0.2) )
         Pawn(Other).WarnTarget(Pawn(Owner), 500, X);
         
      if ( Owner.IsA('Bot') )
           rndDam = whatever value you want here
      else
           rndDam = 9 + Rand(6);
           
      if ( FRand() < 0.2 )
         X *= 2.5;
      Other.TakeDamage(rndDam, Pawn(Owner), HitLocation, rndDam*500.0*X, MyDamageType);
   }
}

Re: Simple code request

Posted: 23 Feb 2018, 07:01
by Lightning Hunter
That did the trick, thanks!

This was an annoyance of mine for years. I was always able to defeat Godlike skill UT99 bots in just about any map except the custom maps with too many Miniguns. This is because the bots literally turn a corner and rip you to pieces in half a second with their deadly accuracy and instant reaction time. There was a very low chance of winning a minigun vs. minigun battle against a godlike bot (at least not one with the same health/armor). Even sniper rifle bots are more fair, because they don't always get headshots (I actually get more headshots than they do I think).

The second most unfair weapon with Godlike bots is actually the Enforcer, but only if you get cornered with no extra armor and no better weapon.

Re: Simple code request

Posted: 23 Feb 2018, 18:26
by Buff Skeleton
I've always preferred a large mass of Inhuman bots to a small number of Godlike ones. Inhuman seems to be more, well... human, despite the name. They often seem to make mistakes that would be believable, yet are still quite good at giving you a hard time (as far as anything without sapient intelligence can be at least).

Re: Simple code request

Posted: 23 Feb 2018, 18:44
by Lightning Hunter
Buff Skeleton wrote:I've always preferred a large mass of Inhuman bots to a small number of Godlike ones. Inhuman seems to be more, well... human, despite the name. They often seem to make mistakes that would be believable, yet are still quite good at giving you a hard time (as far as anything without sapient intelligence can be at least).


Yeah, I do that sometimes too. However, even with inhuman bots there is a noticeable imbalance between the minigun and other guns used by the bots. They really suck with the Eightball. It has always bothered me that the bots immediately become 3x harder while wielding a minigun. It doesn't help that Epic decided to make your screen light up and shake when you are getting hit with the minigun, so you can't return fire very well. Basically, you see the bot turn the corner for a split second before you are impaired and killed.

I actually seldom met players online that preferred the Minigun over other weapons. Most players seeem to prefer the Shock Rifle, Eightball gun, or Sniper Rifle. I never liked the minigun as much because of the huge muzzle flash that obscures your view as you fire. For some reason, this always reduced my accuracy. The Sniper Rifle was always my preferred weapon. The bots, however, are obviously not affected by such things and have perfect aim with the minigun.