Quote:
Originally Posted by mreeuwij
This makes it easier to edit the bound keys (only 1 bind per key in the script, instead of 3 per key) without errors...
|
No arguments against that. Going to actually incorporate that, thanks.
Quote:
Originally Posted by stabby stabby
Nice work! What should I label it as in the OP?
|
It's really just kind of an improvement on Virus's script. I used it as a base, and rewrote all the aliases so that they would be of uniform character length (I'm OCD about that). It cleans it up a bit, but the names are a little arbitrary. I don't think that should matter, though.
I just edited in
mreeuwi's point about binding with aliases and cleaned that up a bit. The main thing I did was separate the variable, customizable functions of the script from the equip command and put them into their own thing (the _mode commands). This doesn't do anything functionally different, but it should let people who aren't terribly experienced with scripting modify it to their liking without wading through the swamp of code.
Here's a modified version of what I've been posting. I included an intro at the top and some modifications at the bottom. Feel free to label it however you want, I'm indifferent either way.
Code:
//Intro
//This script is largely based off of Virus' Viewmodel Adaptation with Quickswitch Support script, found here: http://forums.steampowered.com/forums/showthread.php?t=1591457
//The main changes I made were:
//changed all of the aliases to arbritary names of standardized length
//created the _mode commands
//replaced binds within aliases with aliases (thanks mreeuwi)
//These changes are intended to make the script easier to navigate and change, even with minimal scripting knowledge.
//If you've never scripted before and are using this script, I recommend you look at the examples at the bottom and tweak only the _mode and +_attack commands.
//The examples are just a few demonstrations. Feel free to apply your innate logic and come up with your own modifications.
//Questions can be directed towards the thread linked above or my Steam profile (id/2C3C).
//Cheers, 2C3C
//Base
bind 1 pri
bind 2 sec
bind 3 mel
bind 4 dis
bind 5 eng
bind q switcher
bind mwheelup s_u
bind mwheeldown s_d
bind mouse1 +s_attack
bind mouse2 +attack2
alias pri_mode "r_drawviewmodel 1"
alias sec_mode "r_drawviewmodel 1"
alias mel_mode "r_drawviewmodel 1"
alias +pri_attack "+attack;r_drawviewmodel 1;spec_next"
alias -pri_attack "-attack;r_drawviewmodel 1"
alias +sec_attack "+attack;r_drawviewmodel 1;spec_next"
alias -sec_attack "-attack;r_drawviewmodel 1"
alias +mel_attack "+attack;r_drawviewmodel 1;spec_next"
alias -mel_attack "-attack;r_drawviewmodel 1"
alias prima "slot1; pri_mode; alias +s_attack +pri_attack; alias -s_attack -pri_attack"
alias pri_sec "prima; alias switcher sec_pri; alias pri prima; alias sec sec_pri; alias mel mel_pri; alias dis pda_pri_sec; alias eng pda2_pri_sec; alias s_u mel_pri; alias s_d sec_pri"
alias pri_mel "prima; alias switcher mel_pri; alias pri prima; alias sec sec_pri; alias mel mel_pri; alias dis pda_pri_mel; alias eng pda2_pri_mel; alias s_u mel_pri; alias s_d sec_pri"
alias secon "slot2; sec_mode; alias +s_attack +sec_attack; alias -s_attack -sec_attack"
alias sec_pri "secon; alias switcher pri_sec; alias pri pri_sec; alias sec secon; alias mel mel_sec; alias dis pda_sec_pri; alias eng pda2_sec_pri; alias s_u pri_sec; alias s_d mel_sec"
alias sec_mel "secon; alias switcher mel_sec; alias pri pri_sec; alias sec secon; alias mel mel_sec; alias dis pda_sec_mel; alias eng pda2_sec_mel; alias s_u pri_sec; alias s_d mel_sec"
alias melee "slot3; mel_mode; alias +s_attack +mel_attack; alias -s_attack -mel_attack"
alias mel_pri "melee; alias switcher pri_mel; alias pri pri_mel; alias sec sec_mel; alias mel melee; alias dis pda_mel_pri; alias eng pda2_mel_pri; alias s_u sec_mel; alias s_d pri_mel"
alias mel_sec "melee; alias switcher sec_mel; alias pri pri_mel; alias sec sec_mel; alias mel melee; alias dis pda_mel_sec; alias eng pda2_mel_sec; alias s_u sec_mel; alias s_d pri_mel"
alias pda "slot4"
alias pda_pri_sec "pda; alias switcher pri_sec"
alias pda_pri_mel "pda; alias switcher pri_mel"
alias pda_sec_pri "pda; alias switcher sec_pri"
alias pda_sec_mel "pda; alias switcher sec_mel"
alias pda_mel_pri "pda; alias switcher mel_pri"
alias pda_mel_sec "pda; alias switcher mel_sec"
alias pda2 "slot5"
alias pda2_pri_sec "pda2; alias switcher pri_sec"
alias pda2_pri_mel "pda2; alias switcher pri_mel"
alias pda2_sec_pri "pda2; alias switcher sec_pri"
alias pda2_sec_mel "pda2; alias switcher sec_mel"
alias pda2_mel_pri "pda2; alias switcher mel_pri"
alias pda2_mel_sec "pda2; alias switcher mel_sec"
pri_sec
//Base end
//Some possible modifications (replace the relevant lines above with the lines below, minus the comment slashes)
//Hide Revolver viewmodel on fire (highly recommended)
//alias +pri_attack "+attack;r_drawviewmodel 0;spec_next"
//alias -pri_attack "-attack;r_drawviewmodel 0"
//Hide Revolver viewmodel on equip (not recommended)
//alias pri_mode "r_drawviewmodel 0"
//Auto-sap (personal preference)
//alias pri_mode "r_drawviewmodel 1; -attack"
//alias sec_mode "r_drawviewmodel 1; +attack"
//alias mel_mode "r_drawviewmodel 1; -attack"
//Auto-disguise on knife attack (not recommended)
//alias -mel_attack "-attack;r_drawviewmodel 1; lastdisguise"
//Show viewmodel on cloak (highly recommended) (add the alias lines, replace the bind line)
//bind mouse2 +watch
//alias +watch "+attack2; r_drawviewmodel 1; spec_prev"
//alias -watch "-attack2; r_drawviewmodel 1"
//Quick disguise switch (must bind the +qswitch commands to something) (recommended)
//alias pri_mode "r_drawviewmodel 1; alias -qswitch1 ""; alias -qswitch2 "lastinv"; alias -qswitch3 "lastinv";"
//alias sec_mode "r_drawviewmodel 1; alias -qswitch2 ""; alias -qswitch1 "lastinv"; alias -qswitch3 "lastinv";"
//alias mel_mode "r_drawviewmodel 1; alias -qswitch3 ""; alias -qswitch1 "lastinv"; alias -qswitch2 "lastinv";"
//alias +qswitch1 "slot1; lastdisguise"
//alias +qswitch2 "slot2; lastdisguise"
//alias +qswitch3 "slot3; lastdisguise"
//Different sensitivities for different weapons (personal preference)
//alias pri_mode "r_drawviewmodel 1; sensitivity 1"
//alias sec_mode "r_drawviewmodel 1; sensitivity 3"
//alias mel_mode "r_drawviewmodel 1; sensitivity 3"
//Important:
//IF YOU USE MORE THAN ONE OF THESE, MAKE SURE YOU MIX THEM TOGETHER.
//DON'T MAKE 2 DIFFERENT INSTANCES.
//FOR EXAMPLE:
//Auto-sap and hide Sapper on equip
//alias pri_mode "r_drawviewmodel 1; -attack"
//alias sec_mode "r_drawviewmodel 0; +attack"
//alias mel_mode "r_drawviewmodel 1; -attack"
//NOT THIS:
//Auto-sap and hide Sapper on equip
//alias pri_mode "r_drawviewmodel 1; -attack"
//alias sec_mode "r_drawviewmodel 1; +attack"
//alias mel_mode "r_drawviewmodel 1; -attack"
//alias sec_mode "r_drawviewmodel 0"
Edited to account for mouse-wheel switching.