Forum

How to detect FOV value on QC?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

How to detect FOV value on QC?

Postby Orion » Tue Aug 24, 2010 8:02 pm

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. :)
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Postby Spike » Tue Aug 24, 2010 8:08 pm

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

Postby mh » Tue Aug 24, 2010 10:01 pm

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

Postby Sajt » Wed Aug 25, 2010 12:00 am

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

Postby Orion » Wed Aug 25, 2010 12:23 am

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. :?
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Postby Spike » Wed Aug 25, 2010 12:41 am

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

Postby IceDagger » Wed Aug 25, 2010 7:08 pm

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


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest