An actor must be attached to the bot (if you want I may hand you AttachInfo code). This actor will detect every hider bot around it that moves such that VSize(enemy.velocity) > 50 or some other value. If so, then it registers an inventory subclass called FoundEnemy with a var Pawn Enemy; set to enemy.
Then, the function AssessBotAttitude in your gametype's code (PropHunt I believe?) should return super(TeamDeathmatchPlus).AssessBotAttitude(other) if the assessor bot has a FoundEnemy inventory with its Enemy equal to other; otherwise return ATTITUDE_Ignore (IIRC that's what it's called).
You should also add pathing to your maps, and add quite some random dummy inventory items (LookupSpot - we can also use them for the hider AI!) at key locations (that do nothing and call their own Destroy() function when picked up) with high maxDesireability, so that bots actually wander around.
Finally, to get hider bots to actually hide, I advise using a subclass of the same dummy inventory, but with bInstantRespawn set to True, so that it will always be there, and make it in the code so that:
- The hider bot gets into an area that has hiding spots. Every area with any amount of hiding spot inventory actors around should have a big LookupSpot actor, which you make it so that it triggers every hiding spot that is visible, and in a radius set by the mapper, as long as the triggerer is in the Hider team.
- Every triggered hiding spot inventory will become activated on Trigger() and deactivated on UnTrigger().

Hiding spot dummy inventory code:
Code: Select all
class HidingSpot extends LookupSpot;
var int triggerValue;
function Trigger()
{
triggerValue++;
UpdateTriggerActivity();
}
function UnTrigger()
{
triggerValue--;
UpdateTriggerActivity();
}
function UpdateTriggerActivity()
{
if ( triggerValue > 0 && !IsInState('Inactive') )
GoToState('Inactive')
else if ( IsInState('Inactive') )
GoToState('PickUp')!
}
event PostBeginPlay()
{
super(Inventory).PostBeginPlay();
}
State Inactive
{
ignores Touch;
BeginState()
{
maxDesireability = 0;
}
EndState()
{
maxDesireability = class.default.maxDesireability;
}
}
Code: Select all
class LookupSpotTrigger extends Actor;
function bool IsHider(Actor Other)
{
return PlayerPawn(Other) != None;
// TO-DO for Zac: add code to check the player is a hider. I don't know your gametype code :(
}
event Touch(Actor Other)
{
local HidingSpot HS;
super.Touch();
if ( IsHider(Other) )
foreach VisibleRadiusActors(HidingSpot, HS, HideSpotRadius)
HS.Trigger();
}
event UnTouch(Actor Other)
{
local HidingSpot HS;
super.UnTouch();
if ( IsHider(Other) )
foreach VisibleRadiusActors(HidingSpot, HS, HideSpotRadius)
HS.UnTrigger();
}
Code: Select all
class LookupSpot extends Inventory;
var() float HideSpotRadius;
event PostBeginPlay()
{
super.PostBeginPlay();
Spawn(class'LookupSpotTrigger');
}
state Activated
{
function BeginState()
{
Destroy();
}
}