Hi people..
In my TF mod I'm thinking of making a zoom impulse for the sniper, where he charges up his railgun to deliver more damage.
So, how can I detect a player's last FOV value, using SSQC? So when the player wants to unzoom, he'll return to its old FOV value? Because not everybody plays with fov 90.
Because making FOV to always return to 90 would annoy players who play with FOV higher than 90.
Any help appreciated.
How to detect FOV value on QC?
Short answer: You can't.
Long answer: stuffcmd("cmd myfov $fov\n"); Catch the reply with SV_KRIMZON_PARSECLIENTCOMMAND (your server supports that, right?), and hope that their client supports $cvar expansion.
This should work with fuhquake(+derivatives), fte, dp. Regarding more conventional NQ engines, I've not got a clue which ones might support it.
Long answer: stuffcmd("cmd myfov $fov\n"); Catch the reply with SV_KRIMZON_PARSECLIENTCOMMAND (your server supports that, right?), and hope that their client supports $cvar expansion.
This should work with fuhquake(+derivatives), fte, dp. Regarding more conventional NQ engines, I've not got a clue which ones might support it.
FOV is unfortunately one of those things that isn't communicated to the server. It should be part of any hypothetical extended protocol (either that or the frustum) so that the server could bbox cull entities and reduce bandwidth usage, but maybe there's a valid reason why not that I haven't considered.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Hmm so unfortunately I did this..
I created an impulse which zooms in to fov 40 and charge up the railgun... handled by an invisible entity.
And I createdanother command which unzooms, removes that invisible entity and reset the railgun damage, and I created separate impulses to zoom out to fovs 90, 100, 105, 110, 115, or 120.
Because some engines 'latch' server-controlled vars, like FTE.
But a nice way is to do like in original TF -- hold down fire button to charge, and release it to shoot... but I kinda don't like releasing the button to shoot, so I decided to do that. :?
I created an impulse which zooms in to fov 40 and charge up the railgun... handled by an invisible entity.
And I createdanother command which unzooms, removes that invisible entity and reset the railgun damage, and I created separate impulses to zoom out to fovs 90, 100, 105, 110, 115, or 120.
Because some engines 'latch' server-controlled vars, like FTE.
But a nice way is to do like in original TF -- hold down fire button to charge, and release it to shoot... but I kinda don't like releasing the button to shoot, so I decided to do that. :?
if you're using FTE, just stuffcmd fov to back to the default of 90, and the client will restore the fov to whatever the user wanted for their fov. Its the same with ezquake clients, it just uses quite different logic to achieve the same effect.
Alternatively just use DP_VIEWZOOM fov sniper-type rifles (.float viewzoom), and hope that the client supports it as well as the server.
Alternatively just use DP_VIEWZOOM fov sniper-type rifles (.float viewzoom), and hope that the client supports it as well as the server.