Jump to content

Recommended Posts

There was recently a change to the vanilla code that causes hound followers to remember their player leaders even after the server is reloaded.  While this is technically an improvement, it messes with my code, since I set my hound followers’ stats when they begin following the player, not when the game is loaded..

Surprisingly, I don’t see any posts on these forums on how to “call a function” in this way.  Could anyone please point me in the right direction?

For both prefabs and components, there are two different loading functions available for use: there is OnLoad, and there is OnLoadPostPast (this function has two different names depending on whether its a component or a prefab). Followers are remembered in the data of the leader component, and you'll see the on load post pass searching through the new ents to find the leader's old followers and then adding them.

I would suggest changing the location of your function where you redid their stats, maybe change it to a listen for event function, since a start following event will always be called when a follower is added, regardless of whether it is in game or in load.

Edited by Bad Willow
  • Like 1

@Bad Willow

Hmm, maybe I’m misunderstanding you, but I think I do have a listening event for when they begin following, and it’s not detecting the event when the game is loaded.  I’ll double check though, I wrote this code months ago and the vanilla code only just changed.

Update:  I double checked and yeah, I made it a ListenForEvent (inst:ListenForEvent("startfollowing", OnStartFollowing2)), but it's not detecting the hound followers when the server loads, so their stats aren't being changed..

Edited by FurryEskimo

Update 2:  Upon further testing it seems like hounds are also now able to remember their leaders who enter caves, and go back to following you upon your reemergence..  This is a bit frustrating, since I'm not sure how to give them a command anymore upon the server loading.

Update 3:  The OnStopFollowing code also seems to have stopped working..  Maybe there's more going on here...

Edited by FurryEskimo

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