PDA

View Full Version : Viewmodel config question


swedishsanta
03-19-2012, 06:37 PM
Hello, I have seen videos where the medic switches to medigun and there is no viewmodel of it.

How do you turn the viewmodels off only when using the medigun?
And the same for soldier, what do I have to put in console or in the cfg to make the rocket launcher viewmodel OFF?

... and for pyro flamethrowers?

All help is highly appreciated.

Virus.
03-19-2012, 06:52 PM
It entirely depends on if you want the quickswitch function or not. I can recommend multiple binds that make it completely redundant, provided you use a mouse with side buttons. Not having quickswitch makes it a LOT easier to script out.

Rigel-
03-19-2012, 07:29 PM
You have to have a very basic understanding of how to use class-based scripts in TF2. I'll give you a template to use and an explanation of what to do, then you can do the rest:

bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"

This is something similar to what is in my soldier config. What people are doing when they put this in their configs is they are binding the 1, 2 and 3 keys to weapon slots and viewmodels (on/off). So when you click 1, not only are you bringing out your rocket launcher, but you are also turning view models off.

Put this in your soldier config and it will work on soldier for sure. The next step is to put this in all other class configs as well, EVEN if you don't want them to be changed. The reasoning behind this is if you play soldier, then switch to pyro, these scripts will STILL be in affect, because your pyro config didn't change the 1, 2, 3 keys back to their default bindings, slot1, slot2, slot3.

So basically, put this template in all your configs. You might also want to add slot4 and slot5 commands for the spy and engineer, and the viewmodel command too. Then, edit the values to whatever you want for each weapon in each class.

For example, in your case, you want viewmodels OFF for the medigun, on for all his other weapons. Put this in your medic.cfg:

bind "1" "slot1; r_drawviewmodel 1;" // Needles - viewmodels ON
bind "2" "slot2; r_drawviewmodel 0;" // Medigun - viewmodels OFF
bind "3" "slot3; r_drawviewmodel 1;" // Melee - viewmodels ON

And this in your pyro.cfg:

bind "1" "slot1; r_drawviewmodel 0" // Flamethrower - viewmodels OFF
bind "2" "slot2; r_drawviewmodel 1" // Secondary - viewmodels ON
bind "3" "slot3; r_drawviewmodel 1" // Melee - viewmodels ON

And this in all other class configs:

bind "1" "slot1; r_drawviewmodel 1"
bind "2" "slot2; r_drawviewmodel 1"
bind "3" "slot3; r_drawviewmodel 1"
bind "4" "slot4; r_drawviewmodel 1" // covers engineer/spy, won't affect other classes
bind "5" "slot5; r_drawviewmodel 1" // covers engineer/spy, won't affect other classes

Edit the above values for other classes if you'd like. I'd recommend turning viewmodels off for the spy revolvers as well, as they can be distracting when aiming if you have autoreload on. Like the previous poster mentioned, it gets more complicated if you use quickswitch (Q).

atmosfär
03-19-2012, 07:36 PM
http://code.google.com/p/broesels-crosshair-switcher/

Not_Matlock
03-19-2012, 08:12 PM
http://code.google.com/p/broesels-crosshair-switcher/

This. Very useful.

swedishsanta
03-20-2012, 10:10 AM
You have to have a very basic understanding of how to use class-based scripts in TF2. I'll give you a template to use and an explanation of what to do, then you can do the rest:

bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"

This is something similar to what is in my soldier config. What people are doing when they put this in their configs is they are binding the 1, 2 and 3 keys to weapon slots and viewmodels (on/off). So when you click 1, not only are you bringing out your rocket launcher, but you are also turning view models off.

Put this in your soldier config and it will work on soldier for sure. The next step is to put this in all other class configs as well, EVEN if you don't want them to be changed. The reasoning behind this is if you play soldier, then switch to pyro, these scripts will STILL be in affect, because your pyro config didn't change the 1, 2, 3 keys back to their default bindings, slot1, slot2, slot3.

So basically, put this template in all your configs. You might also want to add slot4 and slot5 commands for the spy and engineer, and the viewmodel command too. Then, edit the values to whatever you want for each weapon in each class.

For example, in your case, you want viewmodels OFF for the medigun, on for all his other weapons. Put this in your medic.cfg:

bind "1" "slot1; r_drawviewmodel 1;" // Needles - viewmodels ON
bind "2" "slot2; r_drawviewmodel 0;" // Medigun - viewmodels OFF
bind "3" "slot3; r_drawviewmodel 1;" // Melee - viewmodels ON

And this in your pyro.cfg:

bind "1" "slot1; r_drawviewmodel 0" // Flamethrower - viewmodels OFF
bind "2" "slot2; r_drawviewmodel 1" // Secondary - viewmodels ON
bind "3" "slot3; r_drawviewmodel 1" // Melee - viewmodels ON

And this in all other class configs:

bind "1" "slot1; r_drawviewmodel 1"
bind "2" "slot2; r_drawviewmodel 1"
bind "3" "slot3; r_drawviewmodel 1"
bind "4" "slot4; r_drawviewmodel 1" // covers engineer/spy, won't affect other classes
bind "5" "slot5; r_drawviewmodel 1" // covers engineer/spy, won't affect other classes

Edit the above values for other classes if you'd like. I'd recommend turning viewmodels off for the spy revolvers as well, as they can be distracting when aiming if you have autoreload on. Like the previous poster mentioned, it gets more complicated if you use quickswitch (Q).

OMFG oh yes. Thank you very much!

atmosfär
03-20-2012, 10:53 AM
Just look at the link I posted...

Anthal
03-20-2012, 11:23 AM
Additionally, you can use bindtoggle to turn them no/off with a single button press.

bindtoggle f r_drawviewmodel

Hitting f turns the models off. Hitting it again turns them back on.

Pröme
03-20-2012, 11:40 AM
You can also use viewmodel_fov 0 instead of r_drawviewmodel. It also disables tracers and f's up medigun beams.

cefyrin
03-20-2012, 02:31 PM
"viewmodel_fov 0; r_drawviewmodel 0" for hitscan to eliminate tracers

"viewmodel_fov 70; r_drawviewmodel 0" for other weapons

Spike Himself
03-20-2012, 06:42 PM
Personaly I like to keep my config files a bit organised (where possible) so binds and aliases don't end up all over the place.

Let me try to explain how I've set up my config files. I'm not going to say this is the one way to achieve what you want; it's merely my way of going about it.


1. Structure
I keep all my aliases in a separate file, which I've conventiently named 'aliases.cfg'. Same story for my binds, which are in 'binds.cfg'. It's important to note that, for the way I've set things up, binds.cfg contains all your *DEFAULT* binds. binds.cfg starts with the 'unbindall' command which, as you guessed, unbinds all your keys, and then goes on to assign defaults to the keys you use for all the classes (bind "w" "+forward", etc.)

2. Putting it together.
To have my aliases available in my binds config file, the first line in binds.cfg will be:
exec aliases
Following that, in my class specific config files (medic.cfg,
scout.cfg, ..) the first line is this:
exec binds
Now, every time I switch class, that class' config file will be executed, which will trigger binds.cfg to be executed, which triggers aliases.cfg to be executed.

In four simple steps:
1. Switch class
2. Aliases are loaded (aliases.cfg)
3. Binds are reset to default (binds.cfg)
4. Class specific binds are loaded (medic.cfg, scout.cfg, ..)


With that in mind, we can identify the problem you raise in your post: "How do I hide viewmodels for some weapons". Or in other words, for the quick thinker: "How do I bind a different alias to a key for different classes?"

Using my setup, I would go about getting this done like this;

Firstly, In aliases.cfg, create aliases for a bunch of stuff you want done when you switch weapons (such as 'slot1', 'r_drawviewmodel 0', etc.);
alias "syringegun" "slot1; r_drawviewmodel 0"
alias "medigun" "slot2; r_drawviewmodel 1"
alias "bonesaw" "slot3; r_drawviewmodel 1"

This is an excerpt from my own aliases.cfg with a few things stripped out for readability purposes.

Now, in binds.cfg you will have your default weapon keys bind. Using the scrollwheel for example, or simply the numbers on your keyboard. Personally I use the latter because my mouse has that many buttons (yes, it is the Razer Naga);

bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
..etc..

As explained above, binds.cfg will be executed every time you change class. Setting the keys to defaults here will make sure your medic binds won't still be active when you switch to spy, for example.

Finally, medic.cfg:

bind "1" "syringegun"
bind "2" "medigun"
bind "3" "bonesaw"

And that's all there is to it! :D

You may think this seems a bit long winded just to hide viewmodels, and you're probably right.

It's a nice and clean way of keeping your files organised though and it will surely benefit you when you have lots and lots of different aliases and binds.

p.s. slightly unrelated tip: keep your config.cfg read-only so you can watch demos without it screwing over your config! The above wall of text is only a small part of my config setup; I may at some point make a thread explaining the entire thing if people care :)

VickM
03-21-2012, 12:37 AM
Hijacking this thread:

What is a good Viewmodel FOV? I wanna maximize performance, use viewmodels mostly for melee only, but for some secondaries.

indiligens
03-21-2012, 05:52 AM
Pointless "scripts" except the broesel's one because you haven't thought about Q :)

cefyrin
03-21-2012, 07:47 PM
Hijacking this thread:

What is a good Viewmodel FOV? I wanna maximize performance, use viewmodels mostly for melee only, but for some secondaries.

I use 70, but anything higher than that works fine as well

GongKilluminati
03-21-2012, 08:13 PM
search flame's cfg on google.
It allows you to customize which weapons have viewmodels on/off. It also allows you to have different crosshairs for different weapons, auto reload for set weapons... etc. Not hard to figure at all.
For me I have viewmodels off for scattergun, rocket launcher, and shotgun.

GongKilluminati
03-21-2012, 08:14 PM
Hijacking this thread:

What is a good Viewmodel FOV? I wanna maximize performance, use viewmodels mostly for melee only, but for some secondaries.

Just use 90.
When I first started playing, I used to mess around with the fov a lot, now it doesn't even matter. 90 fov 90 viewmodel fov allday.

VickM
03-21-2012, 11:44 PM
Just use 90.
When I first started playing, I used to mess around with the fov a lot, now it doesn't even matter. 90 fov 90 viewmodel fov allday.

Yeah, I just want something that is present but not distracting. It's hard to not get distracted though after playing classes that don't use viewmodels and switching to ones that do.

trogdc
03-22-2012, 04:22 AM
I play with 120 fov on viewmodels I don't have disabled.

zzott
03-22-2012, 05:01 AM
playing with viewmodel_fov 70 for the most. I also have these binds for the times when the viewmodel gets annoying
"bind "r" "drawviewmodel 0"
"bind "t" "drawviewmodel 1"
"bind "mouse4" "drawviewmodel 1"

of course, the scripts above are pretty useful

VickM
03-22-2012, 09:04 AM
Does anyone know like an image or video guide to how the viewmodel FOVs work?

trogdc
03-22-2012, 07:52 PM
Does anyone know like an image or video guide to how the viewmodel FOVs work?

Options > keyboard > advanced > enable developer console
Press ~
type in "viewmodel_fov #"
Higher number moves the weapon farther forward, so you see more of the weapon and character arms. Lower does the opposite. This command wasn't really meant to be messed with, so if you go too high you will see parts of the model that were not meant to be seen, and thus may look odd. 75 is the default I believe, and at 0 bullet tracers no longer appear.

VeLon
03-22-2012, 09:56 PM
Anyone wondering how will viewmodelfov effect the feeling of aiming

I think this post will helping you

http://forums.steampowered.com/forums/showthread.php?t=1649126


and the reason that why people like to using long viewmodelfov

I think these two pictures can explain

short (http://i53.tinypic.com/2m649cy.jpg)
long (http://i53.tinypic.com/ir8d40.jpg)

VickM
03-22-2012, 10:33 PM
Higher number moves the weapon farther forward, so you see more of the weapon and character arms. Lower does the opposite. This command wasn't really meant to be messed with, so if you go too high you will see parts of the model that were not meant to be seen, and thus may look odd. 75 is the default I believe, and at 0 bullet tracers no longer appear.

Interesting....I've been playing with the numbers themselves in my config. The biggest issue is my medigun atm.

trogdc
03-22-2012, 11:17 PM
I would just disable the medigun viewmodel. For some weapons I leave viewmodels on because I feel it helps me aim, but with the medigun you're not even shooting so you might as well maximize the area you can actually see.

VickM
03-23-2012, 01:23 PM
I would just disable the medigun viewmodel. For some weapons I leave viewmodels on because I feel it helps me aim, but with the medigun you're not even shooting so you might as well maximize the area you can actually see.

My heal beam didn't show when I disabled it.

atmosfär
03-23-2012, 04:00 PM
My heal beam didn't show when I disabled it.

Use r_drawviewmodel 0 instead of viewmodel_fov 0

Or just use the damn script I linked to on page 1 :confused:

VickM
03-24-2012, 11:58 AM
Use r_drawviewmodel 0 instead of viewmodel_fov 0

Or just use the damn script I linked to on page 1 :confused:

I'm using broesel crosshair switcher so I can use Q (lastinv) and my mousewheel to switch weapons. I'll try what you said though, hopefully that fixes it.

trogdc
03-24-2012, 12:18 PM
That's the script he linked to.

GongKilluminati
03-24-2012, 02:51 PM
Anyone wondering how will viewmodelfov effect the feeling of aiming

I think this post will helping you

http://forums.steampowered.com/forums/showthread.php?t=1649126


and the reason that why people like to using long viewmodelfov

I think these two pictures can explain

short (http://i53.tinypic.com/2m649cy.jpg)
long (http://i53.tinypic.com/ir8d40.jpg)
That's what the crosshair is for lol.
Who uses their weapon to aim? If I could have viewmodels off for cs I'd do it too.