How to detect FOV value on QC?

Discuss programming in the QuakeC language.
Post Reply
Orion
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

How to detect FOV value on QC?

Post by Orion »

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. :)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

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.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

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
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Eh, serverside frustum culling is no good. Maybe view dir can influence entity replication priority/ordering, but not culling...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Orion
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Post by Orion »

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. :?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

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.
IceDagger
Posts: 25
Joined: Fri Nov 19, 2004 10:43 am

Post by IceDagger »

alternatively, you could probably make some sort of server-side centerprint menu interface and ask the client to input his FOV settings, although that might look a bit messy and inconvenient. It would work regardless of the server and client, however.

Bah... I'm old school.
Post Reply