Is there a way to show the viewmodel for, say, the original and the shotgun, but not the cow mangler?
Please and thank you.
Is there a way to show the viewmodel for, say, the original and the shotgun, but not the cow mangler?
Please and thank you.
As far as I know, you cannot change whether you can see viewmodels based on different weapons. However, you can use a viewmodel toggle.
Something along the lines of
bind "[key]" "incrementvar r_drawviewmodel 0 1 1"
in your config.
https://code.google.com/p/broesels-crosshair-switcher/
Sets different crosshairs, colours, viewmodel on/off and indiviual weapons' fov
Edit: Note that this script only sets 1/2/3 with primary/secondary/melee and doesn't not have the ability set crosshair and other settings to weapons, so what Snowy wants for individual weapons does not exist (as far as I know).
ffaAs far as I know, you cannot change whether you can see viewmodels based on different weapons.
You poor fuck.
It is very possible. If you simply search "weapon specific viewmodel script for tf2" on google you will find many different ways to do this.
This comes close to what you want. What this does is let you hit any key (the code here uses t) to toggle whether or not you want the slot to be visible.
bind 1 "slot1; primary; alias currenttog primarytog"
bind 2 "slot2; secondary; alias currenttog secondarytog"
bind 3 "slot3; melee; alias currenttog meleetog"
bind t currenttog
alias currenttog primarytog
alias primary primaryvis
alias primaryvis "r_drawviewmodel 1"
alias primaryhid "r_drawviewmodel 0"
alias primarytog primarytogvis
alias primarytogvis "primaryvis; alias primary primaryvis; alias primarytog primarytoghid"
alias primarytoghid "primaryhid; alias primary primaryhid; alias primarytog primarytogvis"
alias secondary secondaryvis
alias secondaryvis "r_drawviewmodel 1"
alias secondaryhid "r_drawviewmodel 0"
alias secondarytog secondarytogvis
alias secondarytogvis "secondaryvis; alias secondary secondaryvis; alias secondarytog secondarytoghid"
alias secondarytoghid "secondaryhid; alias secondary secondaryhid; alias secondarytog secondarytogvis"
alias melee meleevis
alias meleevis "r_drawviewmodel 1"
alias meleehid "r_drawviewmodel 0"
alias meleetog meleetogvis
alias meleetogvis "meleevis; alias melee meleevis; alias meleetog meleetoghid"
alias meleetoghid "meleehid; alias melee meleehid; alias meleetog meleetogvis"
Part of my Soldier config:
bind "MWHEELUP" "slot1;r_drawviewmodel 0"
bind "MWHEELDOWN" "slot2;r_drawviewmodel 0"
bind q "slot3;r_drawviewmodel 1""
Something you could do is save different Soldier configs, and have binds to exec whichever corresponds to your primary weapon, since you mentioned Original vs Cowmangler.
I know you can set viewmodels on/off for slots but not based on weapon. (i.e models on for original but not on the cowmangler).
Unless you have a different cfg.
RenhetPart of my Soldier config:
bind "MWHEELUP" "slot1;r_drawviewmodel 0"
bind "MWHEELDOWN" "slot2;r_drawviewmodel 0"
bind q "slot3;r_drawviewmodel 1""
Something you could do is save different Soldier configs, and have binds to exec whichever corresponds to your primary weapon, since you mentioned Original vs Cowmangler.
this or bindtoggle key "r_drawviewmodel" with this you can manualy change viewmodel with a press of a button
Make different loadouts with the weapons you want to use and then make binds that change your loadout as well as change your viewmodel cvar values.
alias loadout1 "defaultrl;load_itempreset 0"
alias loadout2 "cowmangler;load_itempreset 1"
alias loadout3 ""
alias loadout4 ""
bind f1 loadout1
bind f2 loadout2
bind f3 loadout3
bind f4 loadout4
bind 1 key1
bind 2 key2
bind 3 key3
alias defaultrl "alias key1 "slot1;viewmodel_fov 0;r_drawviewmodel 0";alias key2 "slot2;viewmodel_fov 0;r_drawviewmodel 0";alias key3 "slot3;viewmodel_fov 90;r_drawviewmodel 1""
alias cowmangler "alias key1 "slot1;viewmodel_fov 90;r_drawviewmodel 1";alias key2 "slot2;viewmodel_fov 0;r_drawviewmodel 0";alias key3 "slot3;viewmodel_fov 90;r_drawviewmodel 1""
Okay so I tried the toggle and put that in my reset file
//defaults for how hiding weapons is done
alias show_weapon "viewmodel_fov 70; r_drawviewmodel 1"
alias hide_weapon "viewmodel_fov 0" //0.0001 is causing some graphical glitches, keeping it at 0 for now
//undo class specific stuff
//binds
bind 1 weapon1
bind 2 weapon2
bind 3 weapon3
bind q primsecswap
bind MOUSE1 "+attack; current_vis_shootswitch"
bind MOUSE2 "+attack2; current_vis_shootswitch"
bind MOUSE3 "+attack3; current_vis_shootswitch"
bind 1 "slot1; primary; alias currenttog primarytog"
bind 2 "slot2; secondary; alias currenttog secondarytog"
bind 3 "slot3; melee; alias currenttog meleetog"
bind p currenttog
alias currenttog primarytog
alias primary primaryvis
alias primaryvis "r_drawviewmodel 1"
alias primaryhid "r_drawviewmodel 0"
alias primarytog primarytogvis
alias primarytogvis "primaryvis; alias primary primaryvis; alias primarytog primarytoghid"
alias primarytoghid "primaryhid; alias primary primaryhid; alias primarytog primarytogvis"
alias secondary secondaryvis
alias secondaryvis "r_drawviewmodel 1"
alias secondaryhid "r_drawviewmodel 0"
alias secondarytog secondarytogvis
alias secondarytogvis "secondaryvis; alias secondary secondaryvis; alias secondarytog secondarytoghid"
alias secondarytoghid "secondaryhid; alias secondary secondaryhid; alias secondarytog secondarytogvis"
alias melee meleevis
alias meleevis "r_drawviewmodel 1"
alias meleehid "r_drawviewmodel 0"
alias meleetog meleetogvis
alias meleetogvis "meleevis; alias melee meleevis; alias meleetog meleetoghid"
alias meleetoghid "meleehid; alias melee meleehid; alias meleetog meleetogvis"
and everytime I switch weapons it just goes back to showing the weapon. Here's my soldier cfg:
exec reset
alias start_spawn_switch "alias finish_spawn_switch "join_class soldier"; join_class random"
unbind mouse2
unbind 1
unbind 2
unbind 3
unbind q
bind 1 weapon1
bind 2 weapon2
bind 3 weapon3
bind q primsecswap
bind mouse2 primsecswap
bind SPACE +crouchJump
What's interfering? What do I need to fix?
Edit: hooli I just saw your message trying that now
The config worked for me. You might have to press the button an extra time the first time, but it seems to be fine.
Mage everytime I press 1, 2, 3 or q the viewmodel switches back on. That's why I pasted my configs to see if you could figure out what part of my scripts are interfering with yours.
Hooli your script changes the loadouts for me, but the viewmodels stay intact. What should I fix? here's what I've done to it so far:
bind 1 weapon1; key1
bind 2 weapon2; key2
bind 3 weapon3; key3
alias loadout1 "defaultrl;load_itempreset 0"
alias loadout2 "load_itempreset 1"
alias loadout3 "cowmangler;load_itempreset 2"
alias loadout4 "load_itempreset 3"
bind f1 loadout1
bind f2 loadout2
bind f3 loadout3
bind f4 loadout4
alias defaultrl "alias key1 "slot1;viewmodel_fov 0;r_drawviewmodel 0";alias key2 "slot2;viewmodel_fov 0;r_drawviewmodel 0";alias key3 "slot3;viewmodel_fov 90;r_drawviewmodel 1""
alias cowmangler "alias key1 "slot1;viewmodel_fov 90;r_drawviewmodel 1";alias key2 "slot2;viewmodel_fov 0;r_drawviewmodel 0";alias key3 "slot3;viewmodel_fov 90;r_drawviewmodel 1""
The "bind 1 weapon 1" part because otherwise it wouldn't do anything.
SnowyMage everytime I press 1, 2, 3 or q the viewmodel switches back on. That's why I pasted my configs to see if you could figure out what part of my scripts are interfering with yours.
Don't use q. I didn't code that bit in.
I literally just wrote that on the fly.
The issue is that you're unbinding the commands that I set when you join as soldier and then rebinding them to other things. Don't rebind 1, 2, and 3, and it'll work.
Oh okay I changed my 1, 2, 3 to yours and it's working.
But I can't live without my primsecswap. Could you help me figure in that part as well? And thanks for the help!
Adding in the last weapon key would literally double the number of states, and said states would be more complex.
It's definitely possible, but it's a lot of work.
I might be missing an easier way.
It's not the last weapon key, even if you were holding out the melee if you press q twice it would go to your primary then your secondary.
Primsecswap; it's amazing.
Actually I'll try out that first thing posted in the thread, maybe that'll help.
Edit: nope
Edit2: great, now my primsecswap is broken.
Just use Broesel's switcher. No point in wasting time trying to make your own script that'll more than likely break.
No, I like my scripts. All I need to do is get all this working with primsecswap (or a different script that works the same way, perhaps? I've been looking through your Broesel's switcher and it has this "switch_between_slot1_and_slot2" which sounds promising.)
Just curious, how are you guys capable of just writing scripts on the spot? Is there like a guide that lists all the different elements of the code, like a dictionary of scripting language)
SnowyJust curious, how are you guys capable of just writing scripts on the spot? Is there like a guide that lists all the different elements of the code, like a dictionary of scripting language)
There isn't much to the scripting 'language', once you're comfortable with aliasing there isn't much you can't do.
I mean, someone somewhere had to have said "drawviewmodel" will do this-
What are all the other key words? I mean if hooli didn't show me I never would've guessed that load_itempreset is the command that switches loadouts.
Your hud would have to reload every time you switch weapons, so you'd freeze if you were constantly switching hud crosshairs.
I just use two dif small configs on pyro. One On for flaregun and one Off for shotgun. Bind them to two exec on dif button presses and press said button once when you switch loadouts.
SnowyI mean, someone somewhere had to have said "drawviewmodel" will do this-
What are all the other key words? I mean if hooli didn't show me I never would've guessed that load_itempreset is the command that switches loadouts.
http://wiki.teamfortress.com/wiki/List_of_useful_console_commands
BenroadsIs it possible to have it swap hud crosshairs?
Yes. You put one crosshair in your achievment overlay, then toggle that on and off depending on your weapon. You can also put one in net_graph, but that means you'll either have the graph popping up all the time or you'll have to completely disable it.
trogBenroadsIs it possible to have it swap hud crosshairs?Yes. You put one crosshair in your achievment overlay, then toggle that on and off depending on your weapon. You can also put one in net_graph, but that means you'll either have the graph popping up all the time or you'll have to completely disable it.
I have one crosshair I really like but I wanted to put konrwings on scout, how would I do this achievement stuff and how would I remove the other crosshair?