whatsherface Posted June 1, 2018 Share Posted June 1, 2018 Hello again forums! I've been having more trouble with my custom character coding...The perk I'm trying to work on for it changes the amount of time followers will stay with my character. Ideally I'd like permanent followers but if that's not possible, vastly increased following time would be helpful! I had this code working about a year and a half ago, and just no realized it's no longer working. I guess the games changed enough so that this code isn't viable anymore. Anyone have any ideas or some input here? Thanks much <3 --Winifred Follower Time AddComponentPostInit("follower", function(self) local _AddLoyalityTime = self.AddLoyaltyTime function self:AddLoyaltyTime(time, ...) if self.leader and self.leader:HasTag("veryfriendly") and GLOBAL.GetTime() > 0 then time = time * 100 -- TUNE HERE ( you can also add absolute values instead of multiplying) end _AddLoyalityTime(self, time, ...) end end) Link to comment Share on other sites More sharing options...
ptr Posted June 1, 2018 Share Posted June 1, 2018 Have you changed self.maxfollowtime? Link to comment Share on other sites More sharing options...
whatsherface Posted June 2, 2018 Author Share Posted June 2, 2018 (edited) I cant seem to find anything about self.maxfollowtime in the game scripts anywhere, or where it would go. Would it go in my character prefab under local master_postinit = function(inst) like this? Or am completely missing the mark here? self.maxfollowtime:SetMax(99999) Edit: Found it in the Follower component...duh. *facepalm* Would I adjust the function Follower:AddLoyaltyTime(time) using AddComponentPostInit("follower", function(self) still? I see that self.maxfollowtime = nil would changing that to a number value make my old code work, or would it mess with other characters besides my own? Edited June 2, 2018 by whatsherface Link to comment Share on other sites More sharing options...
whatsherface Posted June 2, 2018 Author Share Posted June 2, 2018 Okay, It seems to be working. I'll do some more testing before marking this as solved. Here is the code if anyone is interested in using it for themselves. <3 --Winifred Follower Time AddComponentPostInit("follower", function(self) local _AddLoyalityTime = self.AddLoyaltyTime function self:AddLoyaltyTime(time, ...) if self.leader and self.leader:HasTag("veryfriendly") and GLOBAL.GetTime() > 0 then self.maxfollowtime = 99999 time = time * 100 -- TUNE HERE ( you can also add absolute values instead of multiplying) end _AddLoyalityTime(self, time, ...) end end Link to comment 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