How to make a bot shoot a FortStandardMH?

Tutorials and discussions about Mapping - Introduce your own ones!
User avatar
Barbie
Godlike
Posts: 3040
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

How to make a bot shoot a FortStandardMH?

Post by Barbie »

Another easy question...
T2D of FortStandardMH1

Code: Select all

Begin Actor Class=FortStandardMH Name=FortStandardMH1
     FortName="Cave Startpoint"
     DestroyedMessage="now activated!"
     FootRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo8',iLeaf=921,ZoneNumber=8)
     HeadRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo8',iLeaf=921,ZoneNumber=8)
     ViewRotation=(Yaw=40280)
     Level=LevelInfo'MyLevel.LevelInfo0'
     Tag="CaveFort"
     Event="CDDisp"
     Region=(Zone=ZoneInfo'MyLevel.ZoneInfo8',iLeaf=921,ZoneNumber=8)
     Location=(X=2111.347656,Y=3612.165039,Z=946.099976)
     Rotation=(Yaw=40280)
     OldLocation=(X=2048.000000,Y=3584.000000,Z=902.099976)
     bSelected=True
     CollisionRadius=40.000000
     CollisionHeight=64.000000
     Name="FortStandardMH1"
End Actor
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3275
Joined: Sat Mar 21, 2020 5:32 am

Re: How to make a bot shoot a FortStandardMH?

Post by Buggie »

Well for sure it can be done by set bot Enemy when it see fort nearby.
You can try make fort attitude to hate for players for example. IDK if that help.
Assault manage that AFAIK, by manual set Enemy of bots.
User avatar
sektor2111
Godlike
Posts: 6489
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to make a bot shoot a FortStandardMH?

Post by sektor2111 »

Already done in MH-Frigate_R16 if I well remember the title... ( Shooting Hydraulic Compressor ) + View Support for "EndCam" - after ending match...
It's not the best code concerning Bot because it was "hired" from elsewhere (several things are assumptions) and there might be errors if settings are wrong but... if it's about BOT only, it worked... And... can be disabled/enabled on demand (triggered).

Code: Select all

class Bot_Hunter expands Triggers;

var() bool bOnceOnly, bEnabled;
var() class<Bot> LimitedToClass;
var Bot Pending;
var() float Frequency;
var Actor MyPoint;
var() name PointTag;

event PostBeginPlay()
{
	FindMyPoint();
	Super.PostBeginPlay();
}

function FindMyPoint()
{
	local Actor A;

	if ( PointTag != '' )
	foreach RadiusActors(class'Actor',A,700)
	{
		if ( A != None && A.Tag == PointTag )
		{
			MyPoint = A;
			break;
			log ("Point Set "$A);
		}
	}
}

function Timer()
{
	if ( MyPoint != None && bEnabled && Pending.health > 0 )
	{
		if ( Level.Game.IsA('TeamGamePlus') )
			TeamGamePlus(Level.Game).FindSpecialAttractionFor(Pending)==False;
		if ( MyPoint.bIsPawn )
		{
			Pending.DesiredRotation = Rotation;
			Pending.Velocity=Vect(0,0,0);
			Pending.Target=MyPoint;
			Pending.Enemy=Pawn(MyPoint);
			Pending.GotoState('RangedAttack');
			Pending.SpecialPause = RandRange(0.5,2);
		}
		else
		{
			Pending.DesiredRotation = Rotation;
			Pending.Velocity=Vect(0,0,0);
			Pending.Target=MyPoint;
			Pending.bShootSpecial=True;
			Pending.FireWeapon();
			Pending.bFire = 0;
			Pending.bAltFire = 0;
			Pending.SpecialPause = RandRange(0.5,2);
		}
	}
}

function Touch( actor Other )
{
	if ( Other.IsA('Bot') 
			&& ((LimitedToClass == None) || (Other.Class == LimitedToClass)) )
	{
		Pending = Bot(Other);
		SetTimer(Frequency, false);
		if ( bOnceOnly )
		{
			Disable('Touch');
			Disable('Trigger');
		}
	}
}

function Trigger( actor Other, pawn EventInstigator )
{
	if ( bEnabled )
	{
		Disable('Touch');
		bEnabled = False;
	}
	else
	{
		bEnabled = True;
		Enable('Touch');
	}
}
User avatar
Barbie
Godlike
Posts: 3040
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: How to make a bot shoot a FortStandardMH?

Post by Barbie »

Sadly your "Bot_Hunter" does not work reliable and neither my coded "EnemyTrigger", which sets a touching Bot's enemy to the FortStandardMH: the Bot shoots once, but depending on health the FortStandardMH isn't destroyed, what should be the goal.

Finally I solved it by setting MonsterWayPoint.TriggerItem = (FortStandardMH actor).
"If Origin not in center it be not in center." --Buggie
User avatar
sektor2111
Godlike
Posts: 6489
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to make a bot shoot a FortStandardMH?

Post by sektor2111 »

He, he...MonsterWayPoint always helps Bot... when it comes to some triggering activity, but not many people are willing to help Bots :D .

I used that not a single time - and later MH works(/aka updates) actually ruined things. And then my potential solution would be a normal stock trigger set for "ClassProximity" - BOT - done.

In map which I used, I just disabled WayPoint until Compressor was eliminated - clearly it's needed some "MyLevel". All I have to say these are doable without much effort.