[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Sniper Scope

Sniper Scope

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Sniper Scope

Postby redrum » Mon Oct 20, 2008 2:28 pm

I want to add a scope to my sniper rifle.
I used stuffcmds to alter the FOV.
The problem is that when the scope is disabled I "force" the player to a FOV of 110. What if they were using an FOV of 100? or 90?
How can I reset it back to their original FOV?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby jim » Mon Oct 20, 2008 2:52 pm

Add some oldfov to store the normal fov in it?
zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby redrum » Mon Oct 20, 2008 9:24 pm

Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby Wazat » Mon Oct 20, 2008 9:40 pm

When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby frag.machine » Mon Oct 20, 2008 11:45 pm

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Postby Spike » Tue Oct 21, 2008 2:41 am

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Lardarse » Tue Oct 21, 2008 5:22 am

User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Baker » Tue Oct 21, 2008 6:43 am

User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby redrum » Tue Oct 21, 2008 4:36 pm

Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby Baker » Tue Oct 21, 2008 5:14 pm

Try this and you'll see what I mean.

1. Load up whatever Quakeworld client you use.
2. Load a map
3. In the console, type "set myfov $fov"
4. (you just saved your fov)
5. Now type "fov 20"
6. (you just changed your fov to be really small)
7. Now type "fov"
8. (It will show it is 20, just so you can see what is going on)
9. Now type "set fov $myfov"
10. (You have just restored your FOV to the original fov you were using in step #3)

ezQuake, FTE, DarkPlaces and FuhQuake all support this.

So ...

Player X connects. You stuffcmd him "set myfov $fov" so his FOV is saved.

When you want to change his FOV, stuffcmd him "fov 20" or whatever.

When you want to store it, stuffcmd him "set fov $myfov" and it goes back to his preferred setting.

["set myfov $fov" creates temporary cvar called myfov on the client-side that saves his fov. The server can't read it but you don't care what the value is, just that you can restore that fov value when you need to which you can do by doing the reverse, "set fov $myfov".]
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Tue Oct 21, 2008 6:54 pm

If you make some gamecode that changes the fov and run it in FTE, FTE will latch the client's cvar. Whenever you set it to 90 (the default), it'll remove the latch, when you set it to something other than 90 it'll apply the latch. The user's preference is remembered the whole time, it just won't be used. Then again, viewzoom also works in FTE.
zquake, fuhquake(thus ezquake and any number of derivatives) and qw262 all have a default_fov cvar which works in a similar way to fte's. Its just a little less automatic.
Tbh, id's qw client shouldn't be used at all...

As far as I'm aware, all the above clients other than id's support "cmd myfov $fov\n" too. Although this is risky if your client lags out. Alternatively all can use setinfo as a way to tell the server what to use as the base, but this is not automatic.


set fov $myfov stuff is an extension and can still break if the user gets booted. Considering there's a default_fov or latching in all commonly used qw engines, its not a problem (anyone using id's client probably isn't playing seriously enough to care).
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby redrum » Tue Oct 21, 2008 8:49 pm

Baker, ok I see what you mean. That sounds like it should work the way I want it to.
Can't wait to get home and try it. :)
Spike, thanks for the input!
You guys are very helpfull.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby MeTcHsteekle » Sat Oct 25, 2008 12:23 am

DDDDDDDAAAAAAAANNNNNNYYYYYYYY!!!!!!!!>:0
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby r00k » Sat Oct 25, 2008 5:33 am

maybe is it possible that the server calls a generic aliases

like +fovdefault, or, +fovsnipe and just let the client determine the value?

if at all the client just doesnt change.

ok maybe its late and the beer is talking ... does this make sense??
r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Postby Wazat » Sat Oct 25, 2008 2:16 pm

Well, the beer is right. :) I don't drink, but I do things like this in my mods often.

In Conquest and Ace of Nails for example I have an autoexec.cfg that sets +mlook and then executes game.cfg. That cfg sets up the player's special commands for the mod, both aliases and bindings (B key to buy from shops, secondary fire button, etc). The Readme practically begs the player to edit game.cfg to their liking.

So, you could have a game.cfg (or just autoexec.cfg) have this alias:

// The game calls this alias to zoom in/out with the sniper scope.
// Please change 90 to be the default FOV you play with so it resets
// correctly
alias +scopezoom "fov [some zoom]"
alias -scopezoom "fov 90"


I hope that's helpful.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests