Difference between revisions of "Scripts"

From The MegaTF/TeamFortress Wiki!
Jump to: navigation, search
(2-Touch Grenade Script + Timer)
 
(11 intermediate revisions by 3 users not shown)
Line 20: Line 20:
 
===2-Touch Grenade Script + Timer===
 
===2-Touch Grenade Script + Timer===
 
  <nowiki>
 
  <nowiki>
 +
tp_forceTriggers 1
 
alias gren1prime "primeone; bind x gren1throw"
 
alias gren1prime "primeone; bind x gren1throw"
 
alias gren1throw "throwgren; bind x gren1prime"
 
alias gren1throw "throwgren; bind x gren1prime"
Line 35: Line 36:
 
  <nowiki>
 
  <nowiki>
 
add more styles
 
add more styles
</nowiki>
 
 
==Rocketjump Script==
 
<nowiki>
 
alias fwrj "impulse 7;-forward;+back;rotate 180;+jump;+attack;wait;-attack;-jump;-back;+forward;rotate 180;wait;-forward;impulse 7"
 
bind  mouse4 "fwrj"
 
 
</nowiki>
 
</nowiki>
  
 
''add other styles''
 
''add other styles''
 
  
 
==Generic Zoom Script==
 
==Generic Zoom Script==
Line 51: Line 45:
 
alias z20 "fov 20;wait;sensitivity 0.6;wait;bind mouse2 z105"
 
alias z20 "fov 20;wait;sensitivity 0.6;wait;bind mouse2 z105"
 
alias z105 "fov 105;wait;sensitivity 5;wait;bind mouse2 z20"
 
alias z105 "fov 105;wait;sensitivity 5;wait;bind mouse2 z20"
bind mouse2 "z25"
+
bind mouse2 "z20"
 
</nowiki>
 
</nowiki>
  
Line 60: Line 54:
 
alias pathetic "taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;"
 
alias pathetic "taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;"
 
bind "yourkey" pathetic
 
bind "yourkey" pathetic
</nowiki>
 
==Spy Quick Grapple ==
 
<nowiki>
 
 
//quick grapple script
 
alias +grap "impulse 8; wait; +attack"
 
alias -grap "-attack; wait; impulse 2"
 
bind mouse2 "+grap"
 
</nowiki>
 
==Spy Feign with Backpack Throw ==
 
<nowiki>
 
 
//Feigning with backpack throw
 
alias yesfeign "cl_pitchspeed 100000;+lookup;wait;+lookup;wait;discard;wait;cl_pitchspeed 150;-lookup;wait;force_centerview;wait;feign;wait;bind f unfeign"
 
alias unfeign "feign;wait;bind f yesfeign"
 
bind f yesfeign
 
 
</nowiki>
 
</nowiki>
  
Line 83: Line 61:
 
alias celldrops "dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4"
 
alias celldrops "dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4"
 
bind "key" celldrops
 
bind "key" celldrops
</nowiki>
 
 
==20mm Jump==
 
<nowiki>
 
//hwguy 20mm jump
 
alias 20mmjump "cl_pitchspeed 100000;+lookdown;wait;+attack;wait;+jump;wait;-attack;wait;-jump;wait;-lookdown;wait;force_centerview;wait;cl_pitchspeed 150"
 
bind "key" 20mmjump
 
 
</nowiki>
 
</nowiki>
  
Line 105: Line 76:
 
</nowiki>
 
</nowiki>
  
==Grenade Script For MOUSE3==
+
==Map-Specific Skybox Loader==
When reloading as a soldier, there's not much for your index finger to do so I decided to put the grenades on mouse3 where the index finger can spam them while waiting for reload to finish.
+
You can create a config for each map, and add a skybox loading command to each map config -- but having them all consolidated into one list makes things more manageable.  Just add "exec skyboxes" to the top of each individual class config (ie, soldier.cfg, demoman.cfg, etc) and this will do the rest:
  
Handle granades with just mouse3 and the wheel.
+
<nowiki>
 +
// Simple Automatic SkyBox loader, by Aphasia
 +
// add as many customized map-skybox combos as you like below
 +
// note that setting it to 'none' will unload the skybox, forcing ezq to use original map sky textures as built
  
Mwheelup is primeone, mwheeldown is primetwo. When primed, the mwheel is disabled until mouse3 is pressed and released to throw the grenade so another grenade can't be accidentally primed. Throw is disabled until a grenade is primed. If the grenade is held, the controls reset. It works for flares too.
+
// default skybox - set to none in order to default to map's built-in sky textures when one is not specified below
 +
set newskybox "none"
  
It does take a little getting used to because sometimes a grenade will prime when you're releasing mouse3 from the throw. Lifting the finger straight off will help.
+
// if you want ezquake to alwayse use a certain skybox when not otherwise specified, ignoring all maps'
 +
// built-in sky textures, uncomment the following line and specify the skybox you want as default:
 +
// set newskybox "null_plainsky512"
  
 +
// Set all of your map-specific skyboxes here, comment out or delete ones you do not line, add as necessary:
 +
if $mapname == "2fort4" then set newskybox "null_plainsky512"
 +
if $mapname == "2fort5" then set newskybox "null_plainsky512"
 +
if $mapname == "2fort5r" then set newskybox "null_plainsky512"
 +
if $mapname == "skydomez" then set newskybox "frozendusk"
 +
if $mapname == "beer2" then set newskybox "dejavu512"
 +
if $mapname == "hell99" then set newskybox "none"
 +
if $mapname == "haloween" then set newskybox "none"
 +
if $mapname == "lodge5" then set newskybox "bone-chill512"
 +
if $mapname == "tater2" then set newskybox "mercury512"
 +
if $mapname == "bam4" then set newskybox "moondust-lf512"
 +
if $mapname == "canyon1" then set newskybox "hg512"
 +
if $mapname == "mbases" then set newskybox "seeingred512"
 +
if $mapname == "bases" then set newskybox "seeingred512"
 +
if $mapname == "gods" then set newskybox "badomen512"
 +
//if $mapname == "town2" then set newskybox "urbansp512"
 +
//if $mapname == "spacetf" then set newskybox "xenzone"
  
ruleset default
+
// == DO NOT CHANGE ==
tp_msgtriggers 1
+
// only load a skybox if the currently set skybox differs from specified above for current map...
 
+
if ("$newskybox" == "none") then unset r_skyname
alias +throw        throwgren
+
if ("$r_skyname" != "$newskybox") and ("$newskybox" != "none") then loadsky $newskybox
alias -throw        "unbind mouse3;bind mwheelup primeone;bind mwheeldown primetwo"
+
// == END ==
alias handheld      "unbind mouse3;bind mwheelup primeone;bind mwheeldown primetwo"
+
</nowiki>
alias havegren      "play gren.wav;unbind mwheelup;unbind mwheeldown;bind mouse3 +throw"
 
msg_trigger        havegren "primed" -l 2
 
msg_trigger        handheld "not the pin" -l 1
 

Latest revision as of 16:51, 25 October 2018

General scripts that any class can access should go in config.cfg located in ../quake/fortress/. Class based scripts can go in specific class configs (eg. ../quake/fortress/soldier.cfg)

Generally these scripts are supported by EzQuake.

Grenade Timer

Basic Grenade Script + Timer

Place the following in your config file.

bind  x             "primeone;play gren"
bind  c             "primetwo;play gren"
bind  f             "throwgren"

Place gren.wav in your quake/fortress/sound folder.

2-Touch Grenade Script + Timer

tp_forceTriggers 1
alias gren1prime "primeone; bind x gren1throw"
alias gren1throw "throwgren; bind x gren1prime"
alias gren2prime "primetwo; bind c gren2throw"
alias gren2throw "throwgren; bind c gren2prime"
alias grentime "play gren.wav"
msg_trigger grentime "renade primed"
alias cleargrens "bind x gren1prime; bind c gren2prime"
alias f_death cleargrens
bind x gren1prime
bind c gren2prime

Download grenade timer: GREN.zip

add more styles

add other styles

Generic Zoom Script

This can be applied anywhere, for example in each class config, with custom values, or as an overall zoom script in your main config.cfg

alias z20 "fov 20;wait;sensitivity 0.6;wait;bind mouse2 z105"
alias z105 "fov 105;wait;sensitivity 5;wait;bind mouse2 z20"
bind mouse2 "z20"

Taunts (very important)

alias gogogo "yell;wait;impulse 7;wait;yell;wait;impulse 7;wait;yell;wait;impulse 7;wait;yell;wait;impulse 7;wait;yell;wait;impulse 7;wait;yell;wait;impulse 7;wait;"
bind "yourkey" gogogo
alias pathetic "taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;taunt;wait;impulse 8;wait;"
bind "yourkey" pathetic

Quick Cell Drop

//Cell drop script. Useful for Quick Sentry Gun Building technique
alias celldrops "dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4;wait;dropammo;wait;impulse 4"
bind "key" celldrops

Team Colored Cross-hair

This script will change your cross-hair color to whatever color team you're on. Put the following in your config.cfg.

if $team = "Blue" then crosshaircolor 0 255 255
if $team = "Red" then crosshaircolor 255 0 0
if $team = "Gren" then crosshaircolor 0 255 0
if $team = "Yell" then crosshaircolor 255 255 0
if $team = "blue" then crosshaircolor 0 255 255
if $team = "red" then crosshaircolor 255 0 0
if $team = "gren" then crosshaircolor 0 255 0
if $team = "yell" then crosshaircolor 255 255 0

Map-Specific Skybox Loader

You can create a config for each map, and add a skybox loading command to each map config -- but having them all consolidated into one list makes things more manageable. Just add "exec skyboxes" to the top of each individual class config (ie, soldier.cfg, demoman.cfg, etc) and this will do the rest:

// Simple Automatic SkyBox loader, by Aphasia
// add as many customized map-skybox combos as you like below
// note that setting it to 'none' will unload the skybox, forcing ezq to use original map sky textures as built

// default skybox - set to none in order to default to map's built-in sky textures when one is not specified below
set newskybox "none"

// if you want ezquake to alwayse use a certain skybox when not otherwise specified, ignoring all maps'
// built-in sky textures, uncomment the following line and specify the skybox you want as default:
// set newskybox "null_plainsky512"

// Set all of your map-specific skyboxes here, comment out or delete ones you do not line, add as necessary:
if $mapname == "2fort4"		then set newskybox "null_plainsky512"
if $mapname == "2fort5"		then set newskybox "null_plainsky512"
if $mapname == "2fort5r"	then set newskybox "null_plainsky512"
if $mapname == "skydomez" 	then set newskybox "frozendusk"
if $mapname == "beer2" 		then set newskybox "dejavu512"
if $mapname == "hell99" 	then set newskybox "none"
if $mapname == "haloween" 	then set newskybox "none"
if $mapname == "lodge5" 	then set newskybox "bone-chill512"
if $mapname == "tater2" 	then set newskybox "mercury512"
if $mapname == "bam4" 		then set newskybox "moondust-lf512"
if $mapname == "canyon1" 	then set newskybox "hg512"
if $mapname == "mbases" 	then set newskybox "seeingred512"
if $mapname == "bases" 		then set newskybox "seeingred512"
if $mapname == "gods" 		then set newskybox "badomen512"
//if $mapname == "town2" 	then set newskybox "urbansp512"
//if $mapname == "spacetf" 	then set newskybox "xenzone"

// == DO NOT CHANGE ==
// only load a skybox if the currently set skybox differs from specified above for current map...
if ("$newskybox" == "none") then unset r_skyname
if ("$r_skyname" != "$newskybox") and ("$newskybox" != "none") then loadsky $newskybox 
// == END ==