r/tf2scripthelp • • May 16 '15

Answered Modifying the genemilder viewmodel script so that when the gun is out the viewmodel dissapears? Additional question about watch too.

Hey guys, me again. (This time i hope i do the flair thing right).

I'm currently using the Spy viewmodelsScript created by a moderator here, and it's great!

I used stabbys in the past and didn't really like all the crosshair flashing and not being able to press q or else the script wouldn't work properly.

I especially like this one because i use q to quickswitch between my knife and gun and r to sap.

Here is the script

// ========== INSTRUCTIONS ==========
 
// Edit r_drawviewmodel in the SETTINGS section for whether viewmodels are turned on (1) or off (0)
// r_drawviewmodel in the prs_ aliases is activated when pressing the attack key with the weapon equipped
// r_drawviewmodel in the rls_ aliases is activated when releasing the attack key with the weapon equipped
// r_drawviewmodel in the eq_ aliases is activated when switching to that weapon
 
// To add additional settings on weapon switch, append them to the eq_ aliases.
// To add additional settings on attack/release, append them to the prs_/rls_ aliases.
 
// To change which keys can switch weapons, change or add lines in the BINDS section, binding keys only to the aliases already in the binds section
// Multiple keys can be bound to the same alias and the script will still work correctly
 
// See the following for information on how to install scripts and how to make them class-specific:
// http://www.reddit.com/r/tf2scripthelp/wiki/introduction
 
// To "undo" the script and changes made, remove the script from your relevant cfg files and execute the lines in the SCRIPT OVERWRITE section (remove the comment marks first)
 
 
// ========== BINDS ==========
 
bind 1            eq_slot1
bind 2            eq_slot2
bind 3            eq_slot3
bind mwheelup     eq_invprev
bind mwheeldown   eq_invnext
bind q            eq_lastinv
bind mouse1      +eq_attack
bind mouse2      +eq_attack2
 
 
// ========== SETTINGS ==========
 
alias prs_slot1   "r_drawviewmodel 0"
alias rls_slot1   "r_drawviewmodel 0"
alias prs_slot2   "r_drawviewmodel 1"
alias rls_slot2   "r_drawviewmodel 1"
alias prs_slot3   "r_drawviewmodel 1"
alias rls_slot3   "r_drawviewmodel 1"
 
alias eq_slot1    "slot1; set_slot1; alias at_press prs_slot1; alias at_release rls_slot1; r_drawviewmodel 1"
alias eq_slot2    "slot2; set_slot2; alias at_press prs_slot2; alias at_release rls_slot2; r_drawviewmodel 1"
alias eq_slot3    "slot3; set_slot3; alias at_press prs_slot3; alias at_release rls_slot3; r_drawviewmodel 1"
 
 
// ========== LOGIC ==========
 
alias +eq_attack  "+attack; at_press; spec_next"
alias -eq_attack  "-attack; at_release"
 
alias +eq_attack2 "+attack2; r_drawviewmodel 1; spec_prev"
alias -eq_attack2 "-attack2; r_drawviewmodel 1"
 
alias qs_slot1    "alias eq_invnext eq_slot2; alias eq_invprev eq_slot3; set_lastinv; alias set_lastinv alias eq_lastinv eq_slot1; alias set_slot1 ;         alias set_slot2 qs_slot2; alias set_slot3 qs_slot3"
alias qs_slot2    "alias eq_invnext eq_slot3; alias eq_invprev eq_slot1; set_lastinv; alias set_lastinv alias eq_lastinv eq_slot2; alias set_slot1 qs_slot1; alias set_slot2 ;         alias set_slot3 qs_slot3"
alias qs_slot3    "alias eq_invnext eq_slot1; alias eq_invprev eq_slot2; set_lastinv; alias set_lastinv alias eq_lastinv eq_slot3; alias set_slot1 qs_slot1; alias set_slot2 qs_slot2; alias set_slot3 "
 
qs_slot2
eq_slot1
 
 
// ========== SCRIPT OVERWRITE ==========
 
//r_drawviewmodel 1
//bind 1            slot1
//bind 2            slot2
//bind 3            slot3
//bind mwheelup     invprev
//bind mwheeldown   invnext
//bind q            lastinv
//bind mouse1      +attack
//bind mouse2      +attack2

Now I'm wondering if it's possible to modify it so that even when the gun is out, the viewmodel will go away.

It goes away when i shoot, and after that it stays like that and it becomes a lot easier to aim.

But when i switch to knife and back, or i just start the game in general with the gun out, i have to shoot before the viewmodel disappears. So for me, i have my fov at 90 and it's hard to aim the ambassador or revolver with viewmodels on. So i shoot to be able to get the viewmodel off and aim.

So i'd like to be able to have it so that whenever i have slot 1 out (gun) viewmodel is off. Though i'm also wondering, would i still be able to see my deadringer if i had my gun out? That would be my only problem.

If that's the case, is it possible to add to this script that when i have the gun out my fov is lowered so it's easier to aim and i can still see my watch, but then when i return to my knife it brings my fov back to 90?

I tried messing around with the script a little editing the settings and adding stuff to it, but it didn't really work out.

Any help would be hugely appreciated.

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/clovervidia Batman May 17 '15

Glad you found it useful. If you have any other commands that should be highlighted, do let me know and I'll do my best.