• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

How to make the guard NPC follows me?

FrankZ

Refugee
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)

 
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.

 
Back
Top