• 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 Aztec melee: cause bots to attack?

Six_Ten

Grizzled Veteran
Mar 12, 2006
1,382
400
aztecmod.darkesthourgame.com
I've given my Aztec bots some spears. I can kill bots with them, but the bots don't attack with them. The bots are agressive and surround me, but dont use the melee attack. They do fire darts and arrows, its just the stab or bash attacking they dont use.

Where in the code can I cause the bots to use melee attacks as agressively as they fire rifles and arrows?
 
Found this in ROEngine.ROBot
Im also going to look at adding a weapontype WT...

Begin:
bHasFired = false;
if ( (Pawn.Weapon != None) && Pawn.Weapon.bMeleeWeapon )
SwitchToBestWeapon();
GoalString = GoalString@"Ranged attack";
Focus = Target;
Sleep(0.0);
if ( Target == None )
WhatToDoNext(335);
if ( Enemy != None )
CheckIfShouldCrouch(Pawn.Location,Enemy.Location, 1);
if ( NeedToTurn(Target.Location) )
{
Focus = Target;
FinishRotation();
}
bHasFired = true;
if ( Target == Enemy )
TimedFireWeaponAtEnemy();
else
FireWeaponAt(Target);
Sleep(0.1);
if ( ((Pawn.Weapon != None) && Pawn.Weapon.bMeleeWeapon) || (Target == None) || ((Target != Enemy) && (GameObjective(Target) == None) && (Enemy != None) && EnemyVisible()) )
WhatToDoNext(35);
if ( Enemy != None )
CheckIfShouldCrouch(Pawn.Location,Enemy.Location, 1);
Focus = Target;
Sleep(FMax(Pawn.RangedAttackTime(),0.2 + (0.5 + 0.5 * FRand()) * 0.4 * (7 - Skill)));
WhatToDoNext(36);
if ( bSoaking )
SoakStop("STUCK IN RANGEDATTACK!");
}
 
Upvote 0