Could be asleep, typing random messages instead.

Simple code request

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

Moderators: Semfry, ividyon

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Simple code request

Post Posted: 22 Feb 2018, 22:21

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!
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar AlCapowned
Skaarj Elder Skaarj Elder
Posts: 1174
Joined: 19 Dec 2009, 22:25

Subject: Re: Simple code request

Post Posted: 23 Feb 2018, 00:56

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);
   }
}

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Simple code request

Post Posted: 23 Feb 2018, 07:01

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.
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

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

Subject: Re: Simple code request

Post Posted: 23 Feb 2018, 18:26

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).
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Simple code request

Post Posted: 23 Feb 2018, 18:44

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.
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image


Who is online

Users browsing this forum: No registered users and 10 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited