Heavy scripts

From TF2 Wiki

Share/Save/Bookmark
Jump to: navigation, search
Community script navigation
General scripts
Weapon scripts
General class scripts
Collection scripts
Class scripts
Scout scripts
Soldier scripts
Pyro scripts
Engineer scripts
Heavy scripts
Demoman scripts
Medic scripts
Sniper scripts
Spy scripts



Contents

Spinup Minigun Selection with Weapon Selection Handling and Auto-Reloading Shotgun

This script uses the button you normally use for spinning up to also select Slot1, as well as prevent you from glitching out by trying to switch to shotgun (with auto-reload) while you are either spinning, shooting, or both. If you attempt to spin and/or fire your Minigun and then attempt to do a "slot2; +reload", you will stick yourself in a spinning animation rather than switching off the Minigun.
In order to work around this, a counter mechanic is used to prevent the user from accidentally swapping to Slot2 (shotgun) while holding either or both +attack or +attack2.
All functions and binds are commented in the script itself.
Posted by Essobie
// Spinup Minigun Selection with Weapon Selection Handling and Auto-Reloading Shotgun
// ==================================================================================
alias +hw_attack "+attack; hw_inccount"
alias -hw_attack "-attack; hw_deccount"
	// While attacking, increment counter that disables selecting secondary while non-zero.

alias +hw_primary "slot1; -reload; +attack2; hw_inccount"
alias -hw_primary "-attack2; hw_deccount"
	// Select and spinup weapon and increment counter that disables selecting secondary while non-zero.

alias hw_count_0 "alias hw_inccount hw_count_1; alias hw_deccount hw_count_0; alias hw_secondary hw_secondary_enabled"
alias hw_count_1 "alias hw_inccount hw_count_2; alias hw_deccount hw_count_0; alias hw_secondary hw_secondary_disabled"
alias hw_count_2 "alias hw_inccount hw_count_2; alias hw_deccount hw_count_1; alias hw_secondary hw_secondary_disabled"
	// Counter. When this is non-zero, disallow switching to secondary weapon and enabling auto-reload (which breaks weapon flow)

alias hw_secondary_enabled "slot2; +reload"
alias hw_secondary_disabled ""
	// Two possible states of secondary weapon selection: enabled with auto-reload turned on, or disabled entirely.

alias hw_inccount hw_count_1; alias hw_deccount hw_count_0; alias hw_secondary hw_secondary_enabled
	// Initialization

bind "MOUSE1" "+hw_attack"   // Primary Fire
bind "MOUSE3" "+hw_primary"  // Select and spinup Minigun, disable quick weapon switch and disable auto-reload while pressed.
bind "SPACE"  "hw_secondary" // Selects secondary weapon when +hw_primaryspinup is not pressed.



Fast Sandvich eating

by caa4444

in heavyweapons.cfg //Quiknoms

alias quiknoms "use tf_weapon_lunchbox; taunt; wait 600; lastinv"
bind mouse4 quiknoms


in clear.cfg

unbind mouse4

Machine Mode

This script turns the player into a simple machine of death by causing him to fire continuously (without holding the left mouse button) and crouch. It is useful for a heavy being fed by a dispenser, as the dispenser will give him an unlimited ammo supply. If you want to be a machine for your team but you don't want to be glued to your computer for the entire time, then use this script to enable using Machine Mode. Use SHIFT+Insert to turn Machine Mode on and use SHIFT+Delete to turn it off.
The player crouches in order to mantain a low profile, making him less of a target (especially to enemy snipers). However, the HWG cannot walk while crouched and spinning his gun (or shooting) at the same time. To enable walking but not crouching, remove "+duck" and "-duck" from the script.
Posted by H4l0gen
//--------------------------------------------------
// Machine Mode Toggle
// When machine mode is on, the player will attack without pressing MOUSE1.
// SHIFT+INS will turn on machine mode; SHIFT+DEL will turn it off.


// Whatever INS and DEL generally do ("unbind" means they do nothing)
alias keymod_ins_general "unbind INS"
alias keymod_del_general "unbind DEL"

// Toggle machine mode
alias heavy_machinemodeon "+duck; +attack"
alias heavy_machinemodeoff "-attack; -duck"

// Toggle binds
alias +heavy_enablemachinemode "bind INS heavy_machinemodeon; bind DEL heavy_machinemodeoff"
alias -heavy_enablemachinemode "keymod_ins_general; keymod_del_general"

// Bind the keys
alias +keymod_shift "+heavy_enablemachinemode"
alias -keymod_shift "-heavy_enablemachinemode"
bind SHIFT +keymod_shift;
keymod_ins_general;
keymod_del_general;

Machine Mode simplified

  • Press p (can be changed) to duck and fire your minigun, press m (can be changed) to stop.
  • --By (µÞ{}fT¡34¡™ 10:46, 29 October 2008 (UTC)
//Machine Mode
alias +machine "-attack; +duck"
alias -machine "+attack"
alias stopmachine "-attack; -duck"
bind "p" "+machine"
bind "m" "stopmachine"
  • NOTE: v2 is done by me too.

Machine Mode simplified v2 (1 key to activate, one key to disable)

//Machine Mode
alias "startmachine" "-attack; wait; +duck; +attack"
alias "stopmachine" "-attack; -duck"
bind "p" "startmachine"
bind "m" "stopmachine"

Machine Mode simplified v2 (toggle key)

//Machine Mode
alias "startmachine" "-attack; wait; +duck; +attack; alias machinemode stopmachine"
alias "stopmachine" "-attack; -duck; alias machinemode startmachine"
alias "machinemode" "startmachine"
bind "p" "machinemode"

Machine Mode simplified v2 (hold key)

//Machine Mode
alias "+machinemode" "-attack; wait; +duck; +attack"
alias "-machinemode" "-attack; -duck"
bind "p" "+machinemode"

Auto-Minigun Spin Script

Press your right mouse button to start up the automatic spinning, and press your middle mouse button to stop it.
Based off of the Auto Medigun script by Essobie.
Posted by nickpelone
//Auto Minigun Spinup
alias +autominigun "-attack2; use tf_weapon_minigun"
alias -autominigun "+attack2"
alias stopautominigun "-attack2"

bind "MOUSE2" "+autominigun"                   //Right click to start up the minigun.
bind "MOUSE3" "stopautominigun"                // Middle click to stop the minigun from spinning.

Improved Auto-Minigun Spin Script

Click the right mouse button to toggle the minigun spinning.
Based off of nickpelone's script (see above)
//Minigun auto-spin by Metroid48

alias +togglespinning "+spin"
alias -togglespinning "-spin"

alias togglespin "stop"
alias start "alias togglespin stop; alias -togglespinning -spin"
alias stop "alias togglespin start; alias -togglespinning -nspin"

alias +spin "use tf_weapon_minigun"
alias -spin "+attack2;togglespin"
alias -nspin "-attack2;togglespin"

bind "MOUSE1" "+attack"
bind "MOUSE2" "+togglespinning"

Automatic Chaingun

This is the best script I could come up with for the chain gun. When you are not attacking or spinning the gun, pressing mouse1 attacks until you press mouse1 again, briefly pressing mouse2 spins the gun up. When the gun is spinning, pressing mouse1 attacks and pressing mouse2 stops it spinning. When you are firing, pressing mouse1 stops all fire and pressing mouse2 reverts to spinning. Pressing mouse3 at any time resets everything to default, so you have to press this if you die while spinning or firing. In case that was confusing, the main point is that you don't have to hold down any buttons ever, just click once. Enjoy!

Posted by Viperesque
//Automatic Chaingun by Viperesque

alias "+gunn" "+attack"
alias "-gunn" "bind mouse1 +slowdown; wait; bind mouse2 +spinup2"
alias "+stop" "-attack2; wait; bind mouse1 +gunn"
alias "-stop" "bind mouse2 +spinup"
alias "reset" "-attack2; wait; bind mouse1 +gunn; wait; bind mouse2 +spinup"
alias "+spinup2" "-attack; wait; +attack2; wait; bind mouse1 +gunnem"
alias "-spinup2" "bind mouse2 reset"
alias "+slowdown" "-attack"
alias "-slowdown" "bind mouse1 +gunn; wait; bind mouse2 "+spinup"
alias "+gunnem" "+attack; wait; -attack2; wait; bind mouse2 +spinup2"
alias "-gunnem" "bind mouse1 +slowdown"
alias "+spinup" "+attack2; wait; bind mouse1 +gunnem"
alias "-spinup" "bind mouse2 +stop"
bind mouse1 "+gunn"
bind mouse2 "+spinup"
bind mouse3 "-attack; wait; -attack2; wait; bind mouse1 +gunn; wait; bind mouse2 +spinup"

Yet Another Chaingun (but different!)

So, I hate the other chaingun scripts, I will never get used to the toggle form. So I wrote my own script. A toggle for staying spun up is nice, but I like the press and hold firing mode. the way my script works, is you press M2 to spin up, and once again to stop. If you press and hold M1 (regardless of if you were spun up before), it'll fire. When you stop firing, you will spin down, even if you were spun up. If you want to stay spun up, just tap M2 after you let go of M1. No bugs that I know of.

Posted by Greg Sucks
//Auto-fire script
//Can't beleive I wrote this
//Press Mouse 2 to spin gun, press again to stop
//Press Mouse 1 to fire, and when you let go, you stop spinning
alias togglespin "startspin"
alias startspin "+attack2;alias togglespin stopspin"
alias stopspin "-attack2;alias togglespin startspin"
alias +spinattack "+attack"
alias -spinattack "-attack;stopspin"

bind mouse1 +spinattack
bind mouse2 togglespin


Personal tools