FurryEskimo Posted November 25, 2021 Share Posted November 25, 2021 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? Link to comment https://forums.kleientertainment.com/forums/topic/135630-calling-a-function-on-load/ Share on other sites More sharing options...
skittles sour Posted November 26, 2021 Share Posted November 26, 2021 (edited) 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 November 26, 2021 by Bad Willow 1 Link to comment https://forums.kleientertainment.com/forums/topic/135630-calling-a-function-on-load/#findComment-1517031 Share on other sites More sharing options...
FurryEskimo Posted November 26, 2021 Author Share Posted November 26, 2021 (edited) @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 November 26, 2021 by FurryEskimo Link to comment https://forums.kleientertainment.com/forums/topic/135630-calling-a-function-on-load/#findComment-1517035 Share on other sites More sharing options...
FurryEskimo Posted November 26, 2021 Author Share Posted November 26, 2021 (edited) 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 November 26, 2021 by FurryEskimo Link to comment https://forums.kleientertainment.com/forums/topic/135630-calling-a-function-on-load/#findComment-1517055 Share on other sites More sharing options...
FurryEskimo Posted November 26, 2021 Author Share Posted November 26, 2021 OMG I got it!!!! The tag 'pet_hound' broke it!! Link to comment https://forums.kleientertainment.com/forums/topic/135630-calling-a-function-on-load/#findComment-1517062 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now