Jump to content

How to make the guard NPC follows me?


FrankZ

Recommended Posts

My idea is to make custom melee NPC guards that follow me. They can approach & attack while detecting any enemy around. After killing the target they will follow me again.

 

So far the approach & attack function works properly, but they would nither follow me nor come back after killing the target.

I guess there is some problem in my AItask and AItarget setting. Here is my setting:

 

            <property name="AITask-1" value="ApproachSpot" data="class=EntityPlayer,500"/>
            <property name="AITask-2" value="Territorial"/>
            <property name="AITask-3" value="ApproachAndAttackTarget" data="class=EntityEnemyAnimal,20,EntityZombie,20"/>
            <property name="AITask-4" value="ApproachSpot"/>
            <property name="AITarget-1" value="SetNearestEntityAsTarget" data="class=EntityZombie,0,0,EntityEnemyAnimal,0,0"/>
            <property name="AITarget-2" value="SetAsTargetIfHurt" data="class=EntityZombie,0,0,EntityEnemyAnimal,0,0"/>
            <property name="AITarget-3" value="BlockingTargetTask"/>
            <property name="AITarget-4" value=""/>

 

Seems the "ApproachSpot" doesn't works as I thought.

So anyone get an idea?

(also wonder if there is a AI task value list that I can check for)

Link to comment
Share on other sites

  • 2 weeks later...

try adding the player to the approach and attack tasks list.   But dont add it to the aitarget.   Not sure if it will still attack zombies, but add the player at the end of the list if it wont, that might work.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...