Returning to a client's default FOV.

Author Topic: Returning to a client's default FOV.  (Read 1977 times)

So this was touched up a little on the previous post I made, but I'm in need of a bit more help.

http://pastebin.com/RXkHKHzz

The lines of code used for switching between weapon states are in the link. I'm not sure how to set the client's FOV back to their default FOV after un-aiming.

I have referenced this topic: https://forum.blockland.us/index.php?topic=289786.0
But I still have trouble setting everything up.

Any guidance is appreciated, as well as patience... That would be very appreciated.

Quote from: swollow
that was before when the fov functions were broken and didn't actually return anything but 90

I've tried to fix the fixFov thing w/Gravity Cat's weapons.  I ended up with a half-solution.

%client.getControlCameraFov(); didn't work until after the person has spawned- and their camera is actually working.  So i set it so that it would wait a certain number of seconds after onClientEnterGame() and then it would record %client.defaultFOV = %client.getControlCameraFov();.

It wasn't perfect.  If someone had a particularly slow computer it would take so long to spawn- the fov would end up being 90 no matter what.

And then if someone spawns and immediately zooms in with the F key- that would also screw it up.
But it was better than nothing.

tendon instead of onClientEnterGame package GameConnection::spawnPlayer(%client) up. it's the function that's called when the player spawns

We only want the first time someone spawns.
I guess you could use them in conjunction- but i'm not sure how much error that would save.  How long is it from the moment you spawn until getControlCameraFov() actually works?

probably instantly when the player's camera is created

and for the first problem just set the default fov if client.defaultFOV is an empty string
or check if client.hasSpawnedOnce is false

We only want the first time someone spawns.
I guess you could use them in conjunction- but i'm not sure how much error that would save.  How long is it from the moment you spawn until getControlCameraFov() actually works?
once spawnplayer is called, make "hasSpawnedOnce" on the client be true and aviud default fov saving for later spawnplayer calls

just save the fov before changing it

don't save it on spawn, what if the client changes their fov after?

just save the fov before changing it

don't save it on spawn, what if the client changes their fov after?
there are problems with this
like what if the player is using f to zoom in and then right clicks
what if their fov is glitched from some other weapon
and i doubt people change their fov regularly after they spawn

there are problems with this
like what if the player is using f to zoom in and then right clicks
what if their fov is glitched from some other weapon
and i doubt people change their fov regularly after they spawn
and people can also just tap F to fix their fov if they do something dumb like that


having to fix your fov if you zoomed in is much less of pain than requiring you to reconnect to fix your fov
« Last Edit: December 03, 2016, 01:49:32 PM by Swollow »

and people can also just tap F to fix their fov if they do something dumb like that


having to fix your fov if you zoomed in is much less of pain than requiring you to reconnect to fix your fov
Or you could save the last FOV that you reverted to. If it's less than say 70, then default to the previous FOV.

At that point you'd have to be deliberately trying to make it screw up.

I didn't think this was all that hard, I just figured due to my being naïve with scripting, I wasn't doing something right. I just need help setting this up.