Simple code request
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:
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!
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!