. . . Posted February 14, 2018 Share Posted February 14, 2018 (edited) Hello, if someone can help me out with this that'd be great ! So, my character has a perk to "focus" and when this is happening I want that the player can zoom into "10" distance instead of default "15" min distance of followcamera.lua, and make the max zoomout halved so "25" instead of "50", would something like this be possible and if it is maybe someone knows how to do it? If that's not possible is there just a way to change followcamera.lua is minimum distance to 10 instead of 15? Thanks for reading ! Edited February 14, 2018 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/ Share on other sites More sharing options...
IronHunter Posted February 14, 2018 Share Posted February 14, 2018 There seems to be a few client_only mods that affect the camera: http://steamcommunity.com/sharedfiles/filedetails/?id=1161850231 This one in particular allows for a larger zoomout distance, I am sure that somebody could adapt the code for a custom character. Hopefully somebody with more experience with this can give us some pointers. Cheers, Iron_Hunter Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1004001 Share on other sites More sharing options...
. . . Posted February 18, 2018 Author Share Posted February 18, 2018 bump Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1005689 Share on other sites More sharing options...
nicknightyx Posted February 20, 2018 Share Posted February 20, 2018 Hi there, I'm curious that when your character is in "focus", would the rest of the world slow down while only your character acts at normal speed by any chance? Because I wanted to give my character this feature but was terrified at the thought of the complexity of the code. Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1006648 Share on other sites More sharing options...
. . . Posted February 21, 2018 Author Share Posted February 21, 2018 23 hours ago, nicknightyx said: Hi there, I'm curious that when your character is in "focus", would the rest of the world slow down while only your character acts at normal speed by any chance? Because I wanted to give my character this feature but was terrified at the thought of the complexity of the code. No, sorry and yeah that does seem like it would be a really complex thing to do, sorry I don't know how to help out ! Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1007138 Share on other sites More sharing options...
. . . Posted February 24, 2018 Author Share Posted February 24, 2018 bump Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1008403 Share on other sites More sharing options...
. . . Posted March 5, 2018 Author Share Posted March 5, 2018 bump[ Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1011094 Share on other sites More sharing options...
IronHunter Posted March 5, 2018 Share Posted March 5, 2018 (edited) Hang in there, we talked in private about this. This is what I got to share for anybody else interested. Spoiler AddClassPostConstruct("cameras/followcamera", function(self) local oldZoomIn = self.ZoomIn self.ZoomIn = function(self) local focalpointparent = self.target and self.target.entity:GetParent() or nil if focalpointparent:HasTag("sneaking") then local MINDIST = focalpointparent:HasTag("sneaking") and 10 or self.mindist self.distancetarget = math.max(MINDIST, self.distancetarget - self.zoomstep) self.time_since_zoom = 0 else return oldZoomIn(self)--the intention is to provide better compatibility with other camera mods if they modify this class properly. end end local oldZoomOut = self.ZoomOut self.ZoomOut = function(self) local focalpointparent = self.target and self.target.entity:GetParent() or nil if focalpointparent:HasTag("sneaking") then local MAXDIST = focalpointparent:HasTag("sneaking") and 25 or self.maxdist self.distancetarget = math.min(MAXDIST, self.distancetarget + self.zoomstep) self.time_since_zoom = 0 else return oldZoomOut(self)--the intention is to provide better compatibility with other camera mods if they modify this class properly. --I am pretty certain the client side camera mods will overide this as I don't think they were built with compatibility in mind. end end end) Tested on a caves enabled server by myself. I haven't been able to test it with multiple players, but it works as you described. Cheers, Iron_Hunter Edited March 8, 2018 by IronHunter Retested and fixed using tags instead of inst.variables. Link to comment https://forums.kleientertainment.com/forums/topic/87580-how-to-change-minimum-maximum-camera-distance/#findComment-1011455 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