Inside3D!
     

Adding iron sights?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Tue Aug 25, 2009 10:22 am    Post subject: Reply with quote

avirox wrote:
also tweak the players' FOV by sending a stuffcmd

Nooooooooooo! Please don't do this. Evil or Very Mad

FOV belongs to the player, who may have selected a particular FOV for their own reasons. Shoving in a stuffcmd is like saying "I don't care how you want to play the game, you're playing it MY way". It's not as evil as stomping all over their keybindings from QC, but it's quite evil nonetheless. At the very least plase ensure that you restore their original FOV (and mouse sensitivity and anything else you change) correctly when you're done. If you can't do that then don't do it at all.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Tue Aug 25, 2009 10:47 am    Post subject: Reply with quote

am I the only one that thinks fov changing is a form of cheating?

you can lower it to zoom in to "snipe" shit or raise it to see shit around you. seems cheap and cheating as hell to me.

FOV may belong to the player in Quake, but NOT IN MY MOD Twisted Evil
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Tue Aug 25, 2009 12:27 pm    Post subject: Reply with quote

This is your mod?
Back to top
View user's profile Send private message
avirox



Joined: 16 Aug 2006
Posts: 109

PostPosted: Tue Aug 25, 2009 1:45 pm    Post subject: Reply with quote

mh wrote:
avirox wrote:
also tweak the players' FOV by sending a stuffcmd

Nooooooooooo! Please don't do this. Evil or Very Mad

FOV belongs to the player, who may have selected a particular FOV for their own reasons. Shoving in a stuffcmd is like saying "I don't care how you want to play the game, you're playing it MY way". It's not as evil as stomping all over their keybindings from QC, but it's quite evil nonetheless. At the very least plase ensure that you restore their original FOV (and mouse sensitivity and anything else you change) correctly when you're done. If you can't do that then don't do it at all.


That's part of what using ironsights is. Actually, using CSQC to adjust the view rather than sending a FOV stuffcmd change is probably better, but either way you can easily restore the player's original FOV granted you use a decent engine that can read user cvars.
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Aug 26, 2009 5:32 am    Post subject: Reply with quote

avirox wrote:
That's part of what using ironsights is. Actually, using CSQC to adjust the view rather than sending a FOV stuffcmd change is probably better, but either way you can easily restore the player's original FOV granted you use a decent engine that can read user cvars.


Actually, you could do it with a couple stuffcmd commands and some alias building, if I remember right. Can't you dynamically create an alias that stores the old value of fov (build the alias just before changing fov to zoom), then call the alias to reset fov?

Maybe that's only new engines that can do that.

alias restorefov "fov $fov"

something like that. I'm too tired to think.
_________________
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.
Back to top
View user's profile Send private message MSN Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Aug 26, 2009 7:23 am    Post subject: Reply with quote

mh wrote:
At the very least plase ensure that you restore their original FOV (and mouse sensitivity and anything else you change) correctly when you're done. If you can't do that then don't do it at all.

Also make sure you do this before the user gets disconnected from lag...
Oh? You mean you can't do that?


There's no way to ask a client what fov they prefer, without using extensions. The simplest way is to exec an alias which the user created to reset their fov. And to exec that on map start too.


You can use DP_VIEWZOOM if you want to avoid stuffing fov commands at a client.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Thu Aug 27, 2009 6:58 am    Post subject: Reply with quote

Downsider wrote:
This is your mod?


no, I'm just going to try my hand at it where I plan on fucking with FOV.
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
GiffE



Joined: 08 Oct 2006
Posts: 141
Location: USA, CT

PostPosted: Thu Aug 27, 2009 2:00 pm    Post subject: Reply with quote

Using DP_VIEWZOOM would be significantly easier than a csqc or fov hack.

Stuffcmds are disgusting. They are the reason why I set my config to read-only. Nothing worse than a mod that completely screws up how you would like to play. fov is cheating as far as I'm concerned aswell. Unless you want everyone to zoom (indefinitely) with every gun.
_________________
http://www.giffe-bin.net/
Back to top
View user's profile Send private message Visit poster's website
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Thu Aug 27, 2009 3:19 pm    Post subject: Reply with quote

DP_VIEWZOOM is definately the way to go. Easier than CSQC, much cleaner than stuffcmd and has the advantage of also scaling the mouse sensitivity.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Wed Dec 30, 2009 12:22 pm    Post subject: Re: Adding iron sights? Reply with quote

Biodude wrote:
Hey everyone, I am making a game and I need help on making iron sights in it. Anyone know how?


My guess without thinking too hard is that the view model needs to be "dead" on and you use this engine tutorial ( http://forums.inside3d.com/viewtopic.php?t=1247 ) and a little bit of "alias" trickery for the side view.

Pretending that an engine using that tutorial is used.

bind mouse1 "r_viewmodeloffset 0" // Straight on view ("iron sight")
bind mouse2 "r_viewmodeloffset 10" // Side view ("weapon on side")

I'm highly impressed by Downsider's creative application of ideas. This is a really good solution to a question I've long been wondering. Although an extension is the ideal way to solve this as all game logic really should be part of the "mod" and not hacked on to the engine and stuffed into a .cfg file --- still we are not in that perfect world yet.

/So yes, unless an extension is used this isn't really a QuakeC answer, but I'm thinking this is a "how'd he do that" question and you were assuming the answer was QuakeC.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Wed Dec 30, 2009 2:29 pm    Post subject: Reply with quote

My ironsights use a builtin I made, though, not a viewmodeloffset thingie, although I guess that could work, but the builtin reads the ironsight coords from a text file packaged with the model so you don't have to mess with different numbers in QC :0
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group