Guest User

3-slot quickswitch, passive slot2 toggle

a guest
Mar 2nd, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This script allows settings to switch with the active weapon.
  2. // Only the first 3 slots will be tracked by the scroll wheel and q, specifically this excludes the disguise kit (Spy) and the PDAs (Engineer).
  3. // Medic, Spy, Engineer, and permanent non-active weapon versions are also available, contact the author below.
  4.  
  5. // The script will only work correctly when switching with keys in the BIND section.
  6. // The script cannot know if a weapon switched for any other reason than player input using the keys in the BIND section.
  7. // The script cannot know if a weapon switched successfully, and will always assume it has. Examples that prevent/impede switching:
  8. // - Permanent or temporary non-active weapon like gunboats or a melted spy-cicle
  9. // - Minigun spinup/spindown
  10.  
  11.  
  12. // Written by /u/genemilder (http://steamcommunity.com/id/Seventy_one)
  13.  
  14.  
  15. // ========== INSTRUCTIONS ==========
  16.  
  17. // Edit r_drawviewmodel in the SETTINGS section for whether viewmodels are turned on (1) or off (0)
  18. // r_drawviewmodel in the prs_ aliases is activated when pressing the attack key with the weapon equipped
  19. // r_drawviewmodel in the rls_ aliases is activated when releasing the attack key with the weapon equipped
  20. // r_drawviewmodel in the eq_ aliases is activated when switching to that weapon
  21.  
  22. // To add additional settings on weapon switch, append them to the eq_ aliases.
  23. // To add additional settings on attack/release, append them to the prs_/rls_ aliases.
  24.  
  25. // 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
  26. // Multiple keys can be bound to the same alias and the script will still work correctly
  27.  
  28. // See the following for information on how to install scripts and how to make them class-specific:
  29. // http://www.reddit.com/r/tf2scripthelp/wiki/introduction
  30.  
  31. // 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)
  32.  
  33.  
  34. // ========== BINDS ==========
  35.  
  36. bind 1 eq_slot1
  37. bind 2 sw_slot2
  38. bind 3 eq_slot3
  39. bind mwheelup sw_invprev
  40. bind mwheeldown sw_invnext
  41. bind q sw_lastinv
  42. bind mouse1 +eq_attack
  43. bind rshift sw_loadout
  44.  
  45.  
  46. // ========== SETTINGS ==========
  47.  
  48. alias prs_slot1 "r_drawviewmodel 1"
  49. alias rls_slot1 "r_drawviewmodel 1"
  50. alias prs_slot2 "r_drawviewmodel 1"
  51. alias rls_slot2 "r_drawviewmodel 1"
  52. alias prs_slot3 "r_drawviewmodel 1"
  53. alias rls_slot3 "r_drawviewmodel 1"
  54.  
  55. alias eq_slot1 "slot1; set_slot1; alias at_press prs_slot1; alias at_release rls_slot1; r_drawviewmodel 1"
  56. alias eq_slot2 "slot2; set_slot2; alias at_press prs_slot2; alias at_release rls_slot2; r_drawviewmodel 1"
  57. alias eq_slot3 "slot3; set_slot3; alias at_press prs_slot3; alias at_release rls_slot3; r_drawviewmodel 1"
  58.  
  59.  
  60. // ========== LOGIC ==========
  61.  
  62. alias +eq_attack "+attack; at_press; spec_next"
  63. alias -eq_attack "-attack; at_release"
  64.  
  65. 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 eq_13 eq_slot3"
  66. 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"
  67. 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 ; alias eq_13 eq_slot1"
  68.  
  69. alias ps_slot2 "alias sw_slot2 ; alias sw_invprev eq_13; alias sw_invnext eq_13; alias sw_lastinv eq_13; alias sw_loadout ac_slot2; say_team passive secondary"
  70. alias ac_slot2 "alias sw_slot2 eq_slot2; alias sw_invprev eq_invprev; alias sw_invnext eq_invnext; alias sw_lastinv eq_lastinv; alias sw_loadout ps_slot2; say_team active secondary"
  71.  
  72. ps_slot2
  73. qs_slot3
  74. eq_slot1
  75.  
  76.  
  77. // ========== SCRIPT OVERWRITE ==========
  78.  
  79. //r_drawviewmodel 1
  80. //bind 1 slot1
  81. //bind 2 slot2
  82. //bind 3 slot3
  83. //bind mwheelup invprev
  84. //bind mwheeldown invnext
  85. //bind q lastinv
  86. //bind mouse1 +attack
  87. //unbind rshift
Add Comment
Please, Sign In to add comment