Hi, I've not managed to find anything on this, but I want to make a zoom function on a weapon and I would like to first find the player's normal FOV so i can restore it afterwards to whatever they had set it as.
Possible?
Get player's field of view (fov)?
Re: Get player's field of view (fov)?
no. not possible.
just use .viewzoom instead.
long answer:
stuffcmd(player, "cmd foo $fov\n");
void(string s)SV_ParseClientCommand=
{
tokenize(s);
if (argv(0) == "foo")
sprint(self, "your fov is \"", argv(1), "\"\n");
else
clientcommand(s);
};
of course, as this requires both client and server extensions, both of which basically require an engine that already supports .viewzoom, its generally just better to use .viewzoom instead and not fuck with the client's cvars. those things should be owned by the client and you fucking them up will break configs or whatever if they quit at a bad time.
just use .viewzoom instead.
long answer:
stuffcmd(player, "cmd foo $fov\n");
void(string s)SV_ParseClientCommand=
{
tokenize(s);
if (argv(0) == "foo")
sprint(self, "your fov is \"", argv(1), "\"\n");
else
clientcommand(s);
};
of course, as this requires both client and server extensions, both of which basically require an engine that already supports .viewzoom, its generally just better to use .viewzoom instead and not fuck with the client's cvars. those things should be owned by the client and you fucking them up will break configs or whatever if they quit at a bad time.
Re: Get player's field of view (fov)?
Thanks, I'll look into that.
Re: Get player's field of view (fov)?
FOV, always been to me in MP sense, a cheat / advantage. Set to > 90 the default, and you have a larger view perspective of the map than someone who does not know or want to use a greater FOV. Accoirding to Wikipedia, we all have approx 95 degree FOV -
http://en.wikipedia.org/wiki/Human_eye
http://en.wikipedia.org/wiki/Human_eye
Re: Get player's field of view (fov)?
i prefer fov 110 anything less than 100 looks like im running around with reading glasses on.
@Slack:
So if each player's starting FOV value is variable, and all you are really doing is making a Zoom effect, then the best alternative would be to take the difference on your end.
Meaning, decrement the fov value X number of times when zooming, then increment the fov value THAT many times when returning. All you are controlling is the distance from out to in. (slider bar)
Use .viewzoom to change the fov
or
You could simply *cough* stuffcmd to the client "inc fov 1", "dec fov 1"... x number of times in a loop. I know this is not the best option. But would only require a client that has those console commands, which i think most do.
@Slack:
So if each player's starting FOV value is variable, and all you are really doing is making a Zoom effect, then the best alternative would be to take the difference on your end.
Meaning, decrement the fov value X number of times when zooming, then increment the fov value THAT many times when returning. All you are controlling is the distance from out to in. (slider bar)
Use .viewzoom to change the fov
or
You could simply *cough* stuffcmd to the client "inc fov 1", "dec fov 1"... x number of times in a loop. I know this is not the best option. But would only require a client that has those console commands, which i think most do.