2012-09-14

Black Mesa (Source), extended controls.

Scripts for added functionality with Half-Life 2 mod Black Mesa.
  • Toggle sneaking (almost the speed of crouching)
  • Toggle crouch/duck
  • Quick button for throwing hand grenade (+ back to last weapon)
  • Quick button for crowbar attack
Put this in a .cfg file, for example the already existing autoexec.cfg (which should launch automatically).
..\Steam\steamapps\sourcemods\BMS\cfg

//Toggles "sneaking" with CAPS LOCK
alias "runon" "cl_forwardspeed 450;alias togglerun runoff"
alias "runoff" "-speed;cl_forwardspeed 100;alias togglerun runon"
runon
bind "CAPSLOCK" togglerun

//SHIFT = run + cancel crouch/sneak scripts
alias +running "runon;+speed;duckon"
alias -running "runon;-speed"
bind "SHIFT" "+running"

//Toggles ducking with "C"
alias "duckon" "runon;-duck;alias toggleduck duckoff"
alias "duckoff" "+duck;alias toggleduck duckon"
duckon
bind "c" toggleduck

//CTRL = crouch + cancel sneak
alias +ducking "runon;+duck"
alias -ducking "duckon"
bind CTRL +ducking

//Last used weapon, to work with scripts below
bind q "-attack;lastinv;alias qgrener qgren2"

//Quick whack with crowbar ("melee attack") + return to previous weapon
bind MOUSE4 +qcrow
alias +qcrow "use weapon_crowbar;wait;+attack"
alias -qcrow "-attack;lastinv;use weapon_shotgun;lastinv;use weapon_glock;lastinv"

//Quick grenade + and return to previous weapon
bind MOUSE5 +qgren
alias +qgren "alias qgrener qgren1;use weapon_frag;wait;+attack"
alias -qgren "qgrener"
alias qgren1 "alias qgrener wait;-attack;wait 20;lastinv;use weapon_shotgun;lastinv;use weapon_glock;lastinv" //modify wait accordning to fps.. 60 fps = wait 20, 120 fps = wait 40, etc.
alias qgren2 "alias qgrener" //if manual lastinv, do not wait and do NOT perform another lastinv
alias qgrener qgren1


Hope these helps (and work). If you have suggestions or questions, Twitter @xstioph.

Updated Oct 6th.. Fixed so that after using grennade/melee script shotgun/glock will be set as "last used" instead of the crowbar/grenade.