Jump to content

Custom Perk Help: Increased Follower Time


Recommended Posts

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

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 by whatsherface
Link to comment
Share on other sites

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

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
 Share

×
  • Create New...