Author Topic: Fov Switches to 90 when equipping old Gcat special weapons  (Read 2414 times)

I notice this issue a lot when I use Gcats Special Weapons. I have tried to incorporate the FOV set feature from the Dweps package, however it simply breaks the addon and it fails to show in game. I am not experienced at all in scripting, and I have found this to be a major pet peeve when using since I use 100 FOV instead of the default 90. I could change the FOV number in the basic.cs file, however I worry that it would set the client FOV to 100 instead of their preferred setting.

Is there a way around this issue? Or could a scripter give me a few pointers?

There's no way to know what a client's preferred FOV is unless you make them type a command or something.

There's no way to know what a client's preferred FOV is unless you make them type a command or something.
You can get their current FOV, which as long as you retrieve before changing it, would presumably be their preferred FOV

You can get their current FOV, which as long as you retrieve before changing it, would presumably be their preferred FOV
Huh, you're right. Why do all those add-ons spam that "type /fixfov" stuff then?

Huh, you're right. Why do all those add-ons spam that "type /fixfov" stuff then?
most were created prior to that function bein added in

Huh, you're right. Why do all those add-ons spam that "type /fixfov" stuff then?
I mean, there's nothing wrong with having that. Specifically because sometimes the getfov function fails. But it fails relatively little, so that should be used as a backup, not the main means.

In my experience the getFOV function almost always fails, returning 90 no matter what. I got the best results by getting the clients FOV 1 second after they spawned in

In my experience the getFOV function almost always fails, returning 90 no matter what. I got the best results by getting the clients FOV 1 second after they spawned in
That's been my experience as well.  That value isn't set until after the client has spawned and loaded in.  On older laggier computers it may take even longer than 1 second for the value to be set. :c

From what I can tell the value also seems to reset back to 90 after the client's player dies, or at-least some amount of time after the client has spawned

you have to call it on the object the client is currently controlling - otherwise it always returns 90. the best method in general is to capture the FOV the client had right before "scoping in" and then restoring it to that value when unscoping/on death.

you have to call it on the object the client is currently controlling - otherwise it always returns 90. the best method in general is to capture the FOV the client had right before "scoping in" and then restoring it to that value when unscoping/on death.

Makes sense, but how do I go about reworking the script to include that function? Again, I'm not experience in scripting, and I am not sure how to manipulate the code to accept that getFov function.

you have to call it on the object the client is currently controlling - otherwise it always returns 90. the best method in general is to capture the FOV the client had right before "scoping in" and then restoring it to that value when unscoping/on death.

Oh so I'm supposed to be calling it on the player?

Oh so I'm supposed to be calling it on the player?
iirc yes, and if they're in camera then the camera, not the player. not 100% sure but like 80% sure, cause i recall running into this problem a while back and finding out that that was the fix.