Jump to content

Recommended Posts

I'm trying to modify some follower behavior and while I've found out how to modify the component itself, for some reason the distance that creatures follow at seems to be entirely arbitrary and unique to it's prefab.

For example, when modifying one creature, it will continue to walk forward while touching the players, while with another, it will stop at a reasonable distance unless the player walks away, in which case it follows. The MIN_FOLLOW_DISTANCE, TARGET_FOLLOW_DISTANCE, and MAX_FOLLOW_DISTANCE variables in their brains seem to do absolutely nothing. Where is this information kept????

@StretchVanb The follower behaviour itself is a template made to be able to be manipulated on the fly by whatever is using it.

What you're looking for is controlled in the prefab's AI's brain file.

Excerpt from monkeybrain.lua for the spelunkeys:

Follow(self.inst, function() return self.inst.harassplayer end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST),

Klei uses a behaviour tree node system for its AI, so when the conditions above this one fail then this runs.

Notice the parameters here are similar to the ones you listed there but are defined locally in monkeybrain.lua and could be anything.

 

For you to edit these you'll need to do some brain editing to have your changes take effect.

  • Like 1
44 minutes ago, CarlZalph said:

@StretchVanb The follower behaviour itself is a template made to be able to be manipulated on the fly by whatever is using it.

What you're looking for is controlled in the prefab's AI's brain file.

Excerpt from monkeybrain.lua for the spelunkeys:


Follow(self.inst, function() return self.inst.harassplayer end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST),

Klei uses a behaviour tree node system for its AI, so when the conditions above this one fail then this runs.

Notice the parameters here are similar to the ones you listed there but are defined locally in monkeybrain.lua and could be anything.

 

For you to edit these you'll need to do some brain editing to have your changes take effect.

I’ve been doing said brain editing, I’ve directly overwritten the Follow node with different values for the variables and it did nothing. 
 

Plus, I’m not sure if th MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, and MAX_FOLLOW_DIST listed in any respective brain’s script file actually do what they seem to. For instance, Chester has a minimum follow distance of 0 in chester’s brain file, but Chester stops a respective distance away from you instead of jumping near your character like Chester’s trying to knock you over. But catcoons also have a minimum follow distance of zero and without the extremely short follow time they have by default they just sort of repeatedly bump into the player.

 

I looked into the script for the “follow” brain node and I don’t even see anything that appears to use the minimum follow distance in a way that prevents movement. What’s going on???

 

It has no consistency and my brain is slowly melting.

 

Edit: I do want to specify that this is good advice, I’m grateful!

Edited by StretchVanb

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...