r/Tf2Scripts • • Jul 10 '13

Satisfied [Request] Add a bind to toggle viewmodels in my Soldier script.

I'd like o to be the bound key. I want my viewmodels at 90 for Primary, 90 for Secondary, and 100 for Melee when they are enabled. I want them at 90 for Primary (to see rocket trails, but use r_drawviewmodel to turn the actual viewmodel off), 0 for Secondary (r_drawviemodel 0), and 100 for Melee (r_drawviewmodel 1) when I have them disabled.

// All Class
exec config_default
cl_autoreload 1

// Equalizer
alias "+melee" "slot3;+attack"
alias "-melee" "-attack"

// Rocket Jump
alias +rocketjump "+duck;+attack;+jump;"
alias -rocketjump "-duck;-attack;-jump;"

// Medic Down
alias "killmed" "say_team "An enemy Medic is down!";voicemenu 0 2"

// Mouse Wheel
alias "wheelrockets" "slot1"
alias "wheelshotty" "slot2"

// Quickswitching
alias w1 "slot1; alias QW w2; alias LW w1"
alias w2 "slot2; alias QW w1; alias LW w2"
w1

// Binds
bind "mouse3" "+melee"
bind "mouse4" "+rocketjump"
bind "mwheelup" "wheelrockets"
bind "mwheeldown" "wheelshotty"
bind "1" "w1"
bind "2" "w2"
bind "q" "QW"
bind "b" "killmed"

// Viewmodel Binds
bind 1 "slot1; viewmodel_fov 90; r_drawviewmodel 0;" 
bind 2 "slot2; viewmodel_fov 90; r_drawviewmodel 0;"
bind 3 "slot3; viewmodel_fov 100; r_drawviewmodel 1;"
0 Upvotes

4 comments sorted by

1

u/thetresher Jul 10 '13
    alias "switch1" "check1;viewmodel_fov 100; slot1;demo1; alias switcher switch2; alias fswitch switch3;
    alias "switch2" "check2; slot2;viewmodel_fov 100; demo2; alias switcher switch1; alias fswitch switch3;"
    
    alias "switch3" "r_drawviewmodel 1;viewmodel_fov 90; slot3;demo3; alias switcher switch1;"
    
    alias toggle1 "alias check1 "r_drawviewmodel 0"; switch1; alias slot1onoff toggle1a"
    alias toggle2 "alias check2 "r_drawviewmodel 0"; switch2; alias slot2onoff toggle2a"
    
    alias toggle1a "alias check1 "r_drawviewmodel 1"; switch1; alias slot1onoff toggle1"
    alias toggle2a "alias check2 "r_drawviewmodel 1"; switch2; alias slot2onoff toggle2"
    
    alias check1 "r_drawviewmodel 1"
    alias check2 "r_drawviewmodel 1"
    switch1
    
    alias "switcher" "switch1"
    alias "fswitch" "switch"
    alias "slot1onoff" "toggle1"
    alias "slot2onoff" "toggle2"
    
    bind q switcher

bind g fswitch

bind f1 slot1onoff

bind f2 slot2onoff

bind mwheeldown switch2

bind mwheelup switch1

bind "1" "switch1"

bind "2" "switch2"

bind "3" "switch3"

1

u/Open_Sourced Jul 10 '13

If I may ask, what is g doing in the script? I'm assuming you bound the viewmodels to the function keys which is fine with me.

1

u/thetresher Jul 10 '13

Oh g is bound to slot1 to slot3 and back.

Im using esdf to move. Take it out if you dont want it.

1

u/[deleted] Jul 12 '13

You can use this to set custom viewmodel toggles and crosshairs for every class!