Difference between revisions of "Scripting/es"

From Team Fortress Wiki
Jump to: navigation, search
(The + and - commands: translated another section)
m (Minor fix)
 
(30 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Open Review}}
+
{{DISPLAYTITLE:Scripts}}
{{DISPLAYTITLE: Scripts}}
+
{{Quotation|'''El Engineer''' haciendo [[sentry jump/es|salto con arma centinela]] con un script.|This thing ain't on auto-pilot, son!|sound=Engineer_wranglekills01_es.wav}}
 +
Los '''scrips''' son parámetros de los archivos de configuración ({{code|.cfg}}) empleados principalmente para asignar teclas, combinaciones y alias, así como automatizar comportamientos complejos y secuencias de comandos de [[Console/es|consola]]. A diferencia de los [[hacking/es|hacks]], los scripts forman parte del código fuente de ''Team Fortress 2'' y no están vetados por el VAC ([[Valve Anti-Cheat/es|sistema antitrampas de Valve]]). El uso de scripts varía desde una simple asignación de un comando a una tecla a alias para redefinir otras combinaciones. Toda combinación que se puede ejecutar mediante la creación de un script, se puede ejecutar sin él. El script simplemente facilita la realización de dicha acción en el fragor de la batalla.
  
Los '''Scrips''' son configuraciones que crean nuevas entradas llamados "Binds" o "Alias".
 
  
*Los Binds consisten en enlazar un comando de la consola con una tecla, como por ejemplo una acción como disparas, o escribir automáticamente algo en el chat.
+
== Scripts de comandos ==
 +
A continuación se muestra una lista de comandos sin uso, más allá de la elaboración de scripts, por lo que no influyen en la jugabilidad directamente.
  
*Los Alias consisten en usar dos acciones a la vez con una sola tecla. El más común es el de saltar y agacharte a la vez con pulsar solo el {{key|Espacio}}.
+
=== Comando «bind»===
 +
Este comando es el más simple de todos. Hace que la tecla especificada ejecute la acción deseada. Dicha acción puede ser un ajuste, un comando o un script.
  
Estos '''Scripts''' se pueden compartir, pero también los puede haber de creación propia, esto es lo que hace que sean distintos unos de otros. Con tiempo y esfuerzo puedes conseguir hacer lo que quieras con tansolo pulsar una sola tecla.
+
<pre>bind [TECLA] [COMANDO]</pre>
 +
Se pueden usar comillas acotando la tecla y/o el comando, es algo opcional pero si el comando tiene espacios entre el valor y el comando será obligatorio el uso de las comillas para que la consola lo interprete adecuadamente. Un ejemplo sería «bind mouse1 "say texto"», donde las comillas acotan el comando «say», que envía el mensaje «texto», lo cual pertenece a un mismo comando.
  
==Archivos de Script Básicos==
+
<pre>bind [TECLA] "[COMANDO 1];[COMANDO 2];[COMANDO 3]"</pre>
 +
Las comillas en la tecla son opcionales, pero en los comandos son obligatorias, si no la consola no los interpretará como comandos consecutivos.
  
El Team Fortress 2 lee automaticamente los archivos del juego y ejecuta los Binds y Alias en ellos.
+
''Nota:'' El comando <pre>say "texto"</pre> es correcto, pero <pre>bind <TECLA> "say "texto""</pre> no lo es. Esto es porque la interpretación de las comillas es errónea y no es necesario que haya comillas entre comillas, ya que eso aborta el comando automáticamente.
Aquí hay una lista de ellos:
 
  
*config.cfg - Esta es la configuración por defecto, la cual se edita automaticamente cuando cambias algo desde el Menú de Opciones. Es mejor no editar este archivo.
+
Hay dos formas de asignar teclas:
 +
<pre>bind e "voicemenu 0 0"</pre>
 +
Este método hará que el jugador llame a un Medic al pulsar {{key|E}}.
  
*autoexec.cfg - Esta es la configuración por defecto, pero aplicada al uso de Binds y Alias. Aqui puedes poner los binds directamente, pero a veces es más sencillo hacer distintos archivos .cfg para cada script.
+
<pre>bind w +forward</pre>
 +
Este método hará que el jugador se desplace hacia delante al mantener {{key|W}}.
  
*<class>.cfg - Esta es la configuración por defecto de cada clase, la cual puedes editar para que los cambios ejercidos (Como viewmodel_fov, o sensibilidad de ratón sean solo en esa clase).
+
=== Comando «toggle» ===
 +
Este comando permite alternar un ajuste entre dos o más valores.
  
==Sintaxis==
+
<pre>toggle sv_cheats 0 1</pre>
  
Aqui una lista de las normas de la sintaxis:
+
=== Comando «bindtoggle» ===
 +
Este comando funciona igual que el anterior, pero se asigna a una tecla.
  
*Para crear cualquier bind necesitas la siguiente estructura:
+
<pre>bindtoggle o sv_cheats 0 1</pre>
 +
:''Nota:'' Si no se especifica ningún valor, ambos comandos variarán entre 0 y 1 por defecto.
 +
En ambos casos, hay que asegurarse de que los valores están fuera de las comillas ("ejemplo" 0 1).
  
:'''comando <argumento1> <argument2o>'''
+
=== Comando «incrementvar» ===
 +
Este comando permite pasar por distintos valores de un comando.
  
:*El Comando es el tipo de script que usarás:
+
<pre>bind MWHEELUP "incrementvar fov_desired 75 90 1"
 +
bind MWHEELDOWN "incrementvar fov_desired 75 90 -1"</pre>
  
::*bind - Usado para bindear una acción o texto a una tecla.            (Por ejemplo: bind "f+use")
+
:'''comando "<argumento1>" "incrementvar <argumento2> X Y Z"'''
::*alias - Usado para ejecutar comando cuando el alias es ejecutado.    (Por ejemplo: alias space "space+ctrl")
 
::*exec - Usado para ejecutar una configuarción que no se haya cargado.  (Por ejemplo: exec etf2l)
 
  
:*<argumento1> Es la tecla en la que quieres que se cree el bind o alias.
+
:*X y Y representan el valor que se quiere ejecutar con <argumento2>.
 +
:*Z es el salto que se hará de un valor a otro.
  
:*<argumento2> Es la acción que hará.
+
Si quieres que en un rango de 1-10 se vaya pasando de 2 en 2 valores, las siglas X Y Z equivaldrían a 1 10 2. Cada vez que se ejecute pasara por 2, 4, 6, 8, 10, 2, 4, 6, 8, 10, etc.
  
*Para introducir más de un comando debes de ponerlo entre comillas y separado por un punto y coma '''(;)'''
+
Esto es un ejemplo de incrementvar real:
Ejemplo:
 
:'''alias "spraynpray" "+attack; wait 500; -attack"'''
 
:'''bind "mouse3" "spraynpray"
 
  
:*Cuando se ejecuto el jugador lanzará un cohete cada 500 FPS (lo que equivale a 5 segundos en un servidor que vaya a 100 FPS) y luego dejará de disparar. El alias se ejecutará cuando pulses {{key|Mouse 3}} que es la rueda.
+
:'''bind "n" "incrementvar net_graphpos 1 3 1"'''
 +
 
 +
Esto hace que la tecla "n" haga pasar el net_graph por 1, 2, o 3.
 +
 
 +
Este ejemplo hará que el [[field of view/es|campo de visión]] aumenta al deslizar hacia arriba y disminuya al deslizar hacia abajo.
 +
:''Nota:'' Un incrementvar se reiniciará si llega a un valor demasiado alto o pequeño. Es decir, si el campo de visión llega a 90, al seguir aumentándolo el siguiente punto volverá a 75, que es el punto más bajo, y viceversa.
 +
 
 +
=== Alias ===
 +
Un alias permite ejecutar varios comandos referenciados en un mismo comando. Esto se puede considerar como un atajo y es útil cuando es necesario efectuar una serie de comandos en repetidas ocasiones.
 +
:''Nota:'' Los nombres de los alias no pueden contener espacios. Pueden contener barras bajas, números y símbolos. Además distinguen entre mayúsculas y minúsculas.
 +
 
 +
<pre>alias Llamar_al_Medic "Voicemenu 0 0"
 +
bind "e" "Llamar_al_Medic"</pre>
 +
Esto funcionaría igual que asignar un comando con «bind», pero advirtiendo al juego de que el comando (o conjunto de comandos) es «Llamar_al_Medic».
 +
 
 +
:''Nota:'' Un alias puede tener el símbolo + frente a él (por ejemplo: +Diagonal), de esta manera posteriormente ejecutará su versión en - (en este caso: -Diagonal). Esto es útil para asignar movimientos.
 +
 
 +
<pre>alias "+Diagonal" "+moveleft; +back"
 +
alias "-Diagonal" "-moveleft; -back"
 +
bind "z" "+Diagonal"</pre>
 +
Esto permite al jugador moverse diagonalmente. Al pulsar {{key|Z}} el jugador se moverá diagonalmente, hacia atrás y a la izquierda.
 +
 
 +
:'''Aviso: ¡El siguiente código no funcionará!'''
 +
<pre>bind "z" "+moveleft; +back"</pre>
 +
Sin embargo, al pulsar {{key|Z}} el jugador se moverá hacia atrás y a la izquierda, el motor del juego no invierte el comando «+back» ya que sería un segundo comando y al soltar {{key|Z}} no haría que el jugador dejase de caminar hacia atrás.
 +
 
 +
===Comando «exec»===
 +
Este comando ejecutará otro archivo. Esto significa que los scripts complejos se puede almacenar en otros archivos, sin ocupar espacio en los generales.
 +
 
 +
<pre>exec autoexec.cfg</pre>
 +
Este script ejecutará el script «autoexec» del jugador.
 +
 
 +
=== Comando «echo» ===
 +
Este comando mostrará texto en la consola. Es útil para acciones de depuración.
 +
 
 +
<pre>echo Los scripts son; echo muy útiles.</pre>
 +
Esto mostrará en la consola <code>Los scripts son</code> y <code>muy útiles.</code> en ''dos líneas separadas''. Esto es debido a que una nueva línea se añade al final de cualquier texto con <code>echo</code>. Los espacios se analizan si están entre dos palabras, o si el texto con «echo» está entre comillas, como en el siguiente ejemplo:
 +
 
 +
<pre>echo " Los scripts son muy útiles.  "</pre>
 +
Los espacios adicionales se mostrarán, ya que la frase está delimitada por las comillas.
 +
:''Nota:'' No es posible mostrar el carácter de las comillas ("), ya que su significado quedaría sin interpretación. Pero sí se puede reproducir una sola comilla (') o las comillas españolas (« »), preferiblemente.
 +
:''Nota:'' El comando echo puede fallar con textos que no estén delimitados por comillas. Por ello, siempre es preferible acotarlo con comillas, haciéndolo más fácil de entender tanto para la consola como para los humanos.
 +
 
 +
=== Comando «wait» ===
 +
Este comando hará que el juego espere un número de fotogramas hasta ejecutar el siguiente comando.
 +
:'''Aviso: Los comandos de espera están desactivados en algunos servidores. Esto hará que algunos scripts fallen e incluso puede causar (en algunos casos medi raros) que el juego se cuelgue. Véase [[#Pruebas con «wait»|Pruebas con «wait»]] para saber cómo proceder.'''
 +
 
 +
<pre>echo ¿Por qué cruzó la gallina la carretera?;wait 300;echo ¡Para cambiarse de acera!</pre>
 +
Este script esperará 300 fotogramas (unos segundos) antes de enviar la segunda línea.
 +
 
 +
== Archivos CFG de clase ==
 +
Al cambiar a ciertas clases, el juego ejecuta los archivos CFG correspondientes (si los hubiera), con el nombre de la clase escogida.
 +
<pre>
 +
scout.cfg
 +
soldier.cfg
 +
pyro.cfg
 +
demoman.cfg
 +
heavyweapons.cfg
 +
engineer.cfg
 +
medic.cfg
 +
sniper.cfg
 +
spy.cfg
 +
</pre>
 +
Esta automatización permite al jugador tener varias asignaciones y ajustes para cada clase.
 +
 
 +
== Opciones de lanzamiento ==
 +
Las opciones de lanzamiento se pueden usar para alterar la forma en la que TF2 se ejecuta. Ya sea en cuanto a rendimiento o a funcionalidades. Véase {{vdc|Command Line Options:es|Opciones de línea de comandos}} para una lista de las opciones de lanzamiento.
 +
 
 +
== Establecer opciones de lanzamiento ==
 +
[[File:Setting Launch Options.png|thumb|none|Una guía visual sobre cómo establecer opciones de lanzamiento (indicado en círculos rojos).]]
 +
# Haz clic derecho en el título del juego en '''Biblioteca''' en Steam y selecciona '''Propiedades'''.
 +
# En la pestaña '''General''' haz clic en el botón '''Establecer opciones de lanzamiento...'''.
 +
# Pon las opciones de lanzamiento que quieras aplicar (asegúrate de separar los códigos con espacios) y haz clic en '''Aceptar'''.
 +
# Cierra la ventana de '''Propiedades''' e inicia el juego.
 +
 
 +
=== Opciones de ventana ===
 +
Esto puede configurarse de forma incorrecta y reducir el rendimiento. Si es posible, es recomendable usar ajustes.
 +
====Resolución====
 +
Opción de lanzamiento: '''-w # -h #'''
 +
:''Descripción:'' Fuerza la resolución de ancho y alto en píxeles.
 +
====Tasa de refresco====
 +
Opción de lanzamiento: '''-freq #'''
 +
:''Descripción:'' Fuerza la tasa de refresco en hercios.
 +
====Modo ventana====
 +
Opción de lanzamiento: '''-windowed'''
 +
:''Descripción:'' Inicia el juego en modo ventana.
 +
====Modo ventana sin bordes====
 +
Opción de lanzamiento: '''-noborder'''
 +
:''Descripción:'' Una vez en modo ventana, se pueden eliminar los bordes, para tenerlo pantalla completa sin bordes. En oposición al modo de pantalla completa.
 +
====Modo pantalla completa====
 +
Opción de lanzamiento: '''-fullscreen'''
 +
:''Descripción:'' Fuerza la resolución del juego en ancho y alto en píxeles.
 +
 
 +
===Soporte periférico===
 +
====Desactivar joystick====
 +
Opción de lanzamiento: '''-nojoy'''
 +
:''Descripción:'' Evita que el sistema cargue la compatibilidad con joystick, mejora el tiempo de inicio y minimiza el uso de memoria. No lo uses si sueles utilizar un mando.
 +
====Desactivar Steam Controller====
 +
Opción de lanzamiento: '''-nosteamcontroller'''
 +
:''Descripción:'' Evita que el sistema cargue la compatibilidad con Steam Controller, mejora el tiempo de inicio y minimiza el uso de memoria. No lo uses si sueles utilizar el mando de Steam.
 +
 
 +
===Soporte de software===
 +
====Desactivar SourceTV====
 +
Opción de lanzamiento: '''-nohltv'''
 +
:''Descripción:'' Desactiva el soporte de [[SourceTV/es|SourceTV]], minimizando el uso de memoria. No lo uses si sueles usar SourceTV en tu cliente.
 +
====Desactivar QuickTime====
 +
Opción de lanzamiento: '''-noquicktime'''
 +
:''Descripción:'' Desactiva el soporte de [[w:es:QuickTime|QuickTime]], minimizando el uso de memoria. No lo uses si sueles usar QuickTime o exportar archivos .MOV.
 +
 
 +
===Opciones de motor===
 +
===Desactivar vídeo introductorio===
 +
Opción de lanzamiento: '''-novid'''
 +
:''Descripción:'' Elimina la introducción de Valve al iniciar el juego, mejorando el tiempo de carga.
 +
====Cambiar límite de partículas====
 +
Opción de lanzamiento: '''-particles #'''
 +
:''Descripción:'' Limita el número de partículas. Establece # a «1» a (un límite de 512) para mejorar el uso de memoria.
 +
====Renderizado de fuente del precaché====
 +
Opción de lanzamiento: '''-precachefontchars'''
 +
:''Descripción:'' Renderiza la fuente del precaché de algunos caracteres, mejorando los tiempos de renderizado.
 +
====Desactivar retransmisión de texutras====
 +
Opción de lanzamiento: '''-no_texture_stream'''
 +
:''Descripción:'' Desactiva las carga de texturas de alta calidad, usando otras más modestas. Al desactivarlo se mejorará el rendimiento en sistemas con gráficos más moderados.
 +
 
 +
===Versión de DirectX (exclusivo de Windows)===
 +
Opción de lanzamiento: '''-dxlevel #'''
 +
:''Descripción:'' Establece la versión DirectX del juego; acepta todos los valores, pero solo son efectivos entre 81 y 100.
 +
::«-dxlevel 100» usa DirectX 9 y Pixel Shader 3.0. El hardware determina las capacidades gráficas.
 +
::«-dxlevel 81» es la versión más estable de DirectX 8 y usa Pixel Shader 1.1. Tiene más rendimiento que las versiones DirectX 9.
 +
:Nota: Al iniciar el juego, este se cerrará y se eliminará la opción de lanzamiento para establecer los archivos de configuración relacionados.
 +
 
 +
== Lista de nombres de tecla ==
 +
Pasa el ratón sobre una tecla para ver el nombre del script. No distingue entre mayúscula y minúscula.
 +
{|
 +
! width="45%" <!-- Main Keyboard -->|
 +
! width="03%" <!-- Spacing      -->|
 +
! width="25%" <!-- Special Keys  -->|
 +
! width="01%" <!-- Spacing      -->|
 +
! width="25%" <!-- Keypad 1      -->|
 +
! width="05%" <!-- Keypad 2      -->|
 +
|-
 +
|
 +
{{tooltip|{{key|ESC}}|ESCAPE}}
 +
{{tooltip|{{key|F1}}|F1}}
 +
{{tooltip|{{key|F2}}|F2}}
 +
{{tooltip|{{key|F3}}|F3}}
 +
{{tooltip|{{key|F4}}|F4}}
 +
{{tooltip|{{key|F5}}|F5}}
 +
{{tooltip|{{key|F6}}|F6}}
 +
{{tooltip|{{key|F7}}|F7}}
 +
{{tooltip|{{key|F8}}|F8}}
 +
{{tooltip|{{key|F9}}|F9}}
 +
{{tooltip|{{key|F10}}|F10}}
 +
{{tooltip|{{key|F11}}|F11}}
 +
{{tooltip|{{key|F12}}|F12}}
 +
 
 +
{{tooltip|{{key|` &nbsp;}}|`}}
 +
{{tooltip|{{key|1}}|1}}
 +
{{tooltip|{{key|2}}|2}}
 +
{{tooltip|{{key|3}}|3}}
 +
{{tooltip|{{key|4}}|4}}
 +
{{tooltip|{{key|5}}|5}}
 +
{{tooltip|{{key|6}}|6}}
 +
{{tooltip|{{key|7}}|7}}
 +
{{tooltip|{{key|8}}|8}}
 +
{{tooltip|{{key|9}}|9}}
 +
{{tooltip|{{key|0}}|0}}
 +
{{tooltip|{{key|-}}|-}}
 +
{{tooltip|{{key|{{=}}}}|{{=}}}}
 +
{{tooltip|{{key|← Retroceso}}|RETROCESO}}
 +
 
 +
{{tooltip|{{key|TAB}}|TAB}}
 +
{{tooltip|{{key|Q}}|Q}}
 +
{{tooltip|{{key|W}}|W}}
 +
{{tooltip|{{key|E}}|E}}
 +
{{tooltip|{{key|R}}|R}}
 +
{{tooltip|{{key|T}}|T}}
 +
{{tooltip|{{key|Y}}|Y}}
 +
{{tooltip|{{key|U}}|U}}
 +
{{tooltip|{{key|I}}|I}}
 +
{{tooltip|{{key|O}}|O}}
 +
{{tooltip|{{key|P}}|P}}
 +
{{tooltip|{{key|[}}|[}}
 +
{{tooltip|{{key|]}}|]}}
 +
{{tooltip|{{key|\ &nbsp; &nbsp; &nbsp;}}|\}}
 +
 
 +
{{tooltip|{{key|⇪ Bloq Mayús}}|BLOQ MAYÚS}}
 +
{{tooltip|{{key|A}}|A}}
 +
{{tooltip|{{key|S}}|S}}
 +
{{tooltip|{{key|D}}|D}}
 +
{{tooltip|{{key|F}}|F}}
 +
{{tooltip|{{key|G}}|G}}
 +
{{tooltip|{{key|H}}|H}}
 +
{{tooltip|{{key|J}}|J}}
 +
{{tooltip|{{key|K}}|K}}
 +
{{tooltip|{{key|L}}|L}}
 +
{{tooltip|{{key|Ñ}}|PUNTO Y COMA (;) (Ñ en teclado español)}}
 +
{{tooltip|{{key|' &nbsp;}}|'}}
 +
{{tooltip|{{key|Entrar ↵}}|ENTRAR}}
 +
 
 +
{{tooltip|{{key|Mayús &nbsp; &nbsp;}}|MAYÚS}}
 +
{{tooltip|{{key|Z}}|Z}}
 +
{{tooltip|{{key|X}}|X}}
 +
{{tooltip|{{key|C}}|C}}
 +
{{tooltip|{{key|V}}|V}}
 +
{{tooltip|{{key|B}}|B}}
 +
{{tooltip|{{key|N}}|N}}
 +
{{tooltip|{{key|M}}|M}}
 +
{{tooltip|{{key|, &nbsp;}}|,}}
 +
{{tooltip|{{key|. &nbsp;}}|.}}
 +
{{tooltip|{{key|/ &nbsp;}}|/}}
 +
{{tooltip|{{key|Mayús &nbsp; &nbsp; &nbsp; &nbsp;}}|MAYÚS DER.}}
 +
 
 +
{{tooltip|{{key|Ctrl &nbsp;}}|CTRL}}
 +
{{tooltip|{{key|⊞}}|WIN. IZQ.}}
 +
{{tooltip|{{key|Alt}}|ALT}}
 +
{{tooltip|{{key|&nbsp; &nbsp; &nbsp; Espacio &nbsp; &nbsp; &nbsp;}}|ESPACIO}}
 +
{{tooltip|{{key|⊞}}|WIN. DER.}}
 +
{{tooltip|{{key|Alt}}|ALT DER.}}
 +
{{tooltip|{{key|Menú}}|No se puede asignar.}}
 +
{{tooltip|{{key|Ctrl &nbsp; &nbsp;}}|CTRL DER.}}
 +
 
 +
|<!-- Spacing -->
 +
|
 +
{{tooltip|{{key|Impr pant}}|No se puede asignar}}
 +
{{tooltip|{{key|Bloq Despl}}|BLOQ DESPL}}
 +
{{tooltip|{{key|Pausa}}|PAUSA}}
 +
 
 +
{{tooltip|{{key|Insert &nbsp;}}|INS}}
 +
{{tooltip|{{key|Inicio}}|INICIO}}
 +
{{tooltip|{{key|Av pág}}|AV PÁG}}
 +
 
 +
{{tooltip|{{key|Suprimir}}|SUPR}}
 +
{{tooltip|{{key|&nbsp; Fin &nbsp;}}|FIN}}
 +
{{tooltip|{{key|Re pág}}|RE PÁG}}
 +
 
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{{tooltip|{{key|&uarr;}}|FLECHA ARRIBA}}
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{tooltip|{{key|&larr;}}|FLECHA IZQ.}}
 +
{{tooltip|{{key|&darr;}}|FLECHA ABAJO}}
 +
{{tooltip|{{key|&rarr;}}|FLECHA DER.}}
 +
|<!-- Spacing -->
 +
|
 +
 
 +
{{Scripting Numpad}}
 +
|}
  
==Comandos Básicos==
+
{|
 +
! align="left"| Botones de ratón
 +
! Nombre del botón
 +
|-
 +
| Deslizar arriba
 +
| MWHEELUP
 +
|-
 +
| Deslizar abajo
 +
| MWHEELDOWN
 +
|-
 +
| Clic izquierdo
 +
| MOUSE1
 +
|-
 +
| Clic derecho
 +
| MOUSE2
 +
|-
 +
| Clic de la rueda
 +
| MOUSE3
 +
|-
 +
| Clic lateral del ratón 1
 +
| MOUSE4
 +
|-
 +
| Clic lateral del ratón 2
 +
| MOUSE5
 +
|}
  
La mayoría de los comandos se aceptar un argumento solo, que es un valor te querer ejecutar.
+
== Comandos útiles ==
 +
<small>Artículo principal: [https://developer.valvesoftware.com/w/index.php?title=List_of_Team_Fortress_2_console_commands_and_variables&uselang=es Lista de variables y comandos de consola de TF2]</small>
  
'''bind "q" "sv_alltalk 1"'''
+
===Disfraces===
 +
El comando <code>disguise</code> tiene dos composiciones, el primero es la clase y el segundo el equipo.
 +
:'''Clase'''
 +
:1. Scout
 +
:2. Sniper
 +
:3. Soldier
 +
:4. Demoman
 +
:5. Medic
 +
:6. Heavy
 +
:7. Pyro
 +
:8. Spy
 +
:9. Engineer
  
Algunos de los comandos se aceptar argumentos múltiplos. Por ejemplo:
+
:'''Equipo'''
 +
:1. BLU
 +
:2. RED
 +
:-1. Equipo contrario
 +
:-2. Mismo equipo
  
*disguise X Y - El Spy se disfraza. "X" es la clase 1-9 y "Y" es el equipo 1 or 2.
+
De esta manera, <code>disguise 5 1</code> disfrazaría de Medic BLU y <code>disguise 7 -2</code> de Pyro amigo.
 +
:''Nota:'' <code>disguise 8 -2</code> (Spy amigo) hará que se desdisfrace.
  
*voicemenu X Y - Ejecutar el comando de voz. "X" es el número de la menú primario. "Y" es el posición del comando en esa menú.
+
=== Construcciones ===
 +
Los comandos <code>build</code> y <code>destroy</code> tienen dos composiciones, el primero es la construcción y el segundo el tipo de construcción.
  
Por ejemplo: "voicemenu 1 1" es el comando para Spy:
+
El comando <code>build</code> saca el plano de la construcción.
 +
:<code>build 0 0</code> construye un [[Dispenser/es|dispensador]] <small>(solo Engineer)</small>
 +
:<code>build 1 0</code> construye una [[teleporter entrance/es|entrada de teleportador]] <small>(solo Engineer)</small>
 +
:<code>build 1 1</code> construye una [[teleporter exit/es|salida de teleportador]] <small>(solo Engineer)</small>
 +
:<code>build 2 0</code> construye un [[Sentry Gun/es|arma centinela]] <small>(solo Engineer)</small>
 +
:<code>build 3 0</code> pone un [[Sapper/es|Zapador]] <small>(solo Spy)</small>
  
'''bind "t" "voicemenu 1 1"'''
+
Del mismo modo, <code>destroy</code> destruirá construcciones.
 +
:<code>destroy 0 0</code> destruirá un dispensador <small>(solo Engineer)</small>
 +
:<code>destroy 1 0</code> destruirá una entrada de teleportador <small>(solo Engineer)</small>
 +
:<code>destroy 1 1</code> destruirá una salida de teleportador <small>(solo Engineer)</small>
 +
:<code>destroy 2 0</code> destruirá un arma centinela <small>(solo Engineer)</small>
 +
:''Nota:'' Los Zapadores no se destruyen con comando.
  
Este comando es para hacer su carácter se dice "Spy!" cuando se pulsa el tecla.
+
Se pueden usar comandos <code>build</code> antiguos, que solo tienen una composición.
 +
:<code>build 0</code> construirá un dispensador <small>(solo Engineer)</small>
 +
:<code>build 1</code> construirá un teleportador de entrada <small>(solo Engineer)</small>
 +
:<code>build 2</code> construirá un arma centinela <small>(solo Engineer)</small>
 +
:<code>build 3</code> construirá un teleportador de salida <small>(solo Engineer)</small>
 +
:<code>build 3</code> pondrá un Zapador <small>(solo Spy) [fuera de uso]</small>
  
==Incrementvar==
+
=== Menú de voz===
 +
El comando <code>voicemenu</code> tiene dos argumentos, el número del menú y del comando.
 +
*<code>voicemenu 0</code>
 +
*:0: {{botignore|¡MEDIC!}}
 +
*:1: ¡Gracias!
 +
*:2: ¡Vamos! ¡Vamos! ¡Vamos!
 +
*:3: ¡Moveos!
 +
*:4: A la izquierda.
 +
*:5: A la derecha.
 +
*:6: Sí.
 +
*:7: No.
 +
*:8: ¡Pásamela!
 +
*<code>voicemenu 1</code>
 +
*:0: Adelante.
 +
*:1: ¡Spy!
 +
*:2: ¡Centinela al frente!
 +
*:3: Teleportador aquí.
 +
*:4: Dispensador aquí.
 +
*:5: Centinela aquí.
 +
*:6: ¡Activa la carga!
 +
*:7: {{botignore|MEDIC: Supercarga lista.}}
 +
*:8: ¡Pásamela!
 +
*<code>voicemenu 2</code>
 +
*:0: ¡Ayuda!
 +
*:1: Grito de guerra.
 +
*:2: Aplausos.
 +
*:3: Ovación.
 +
*:4: Positivo.
 +
*:5: Negativo.
 +
*:6: Buen disparo.
 +
*:7: Buen trabajo.
  
Eso comando es para ciclar a través de un rango de valores cada vez que se ejecutar y se aplicar los valores a el otro comando. Hay el formo:
+
:''Nota'': Si quieres abrir el menú de voz en vez de emitir el mensaje <code>voicemenu <núm> <núm></code>, el comando es <code>voice_menu_<num></code>: donde <núm> es un número del 1 al 3. Del otro modo, para ver el primer menú de voz, el comando es <code>voice_menu_1</code>.
  
:'''comando "<argumento1>" "incrementvar <argument2> X Y Z"'''
+
=== Teleporte Eureka ===
 +
El comando <code>eureka_teleport</code> teleporta a un Engineer con el {{item link|Eureka Effect}} a su base o salida del teleportador si la hay.
 +
*<code>eureka_teleport 0</code> teleportará al jugador a su base.
 +
*<code>eureka_teleport 1</code> teleportará al jugador a su [[teleporter exit/es|teleportador de salida]].
  
:*X y Y represente el rango de valores se quiere ejecutar con <argumento2>.
+
El jugador verá «Unknown command» en la [[console/es|consola]] aunque funcione.
:*Z es el tamaño del paso se quiere hacer mientras que se ciclando a través del rango.
 
  
Si te quiere un rango de valores de 1-10 y te quiere incrementar su valor por 2 cada vez que el comando se ejecutar, X Y Z debe ser 1 10 2. Cada vez que ejecutar, <argumento2> ejecutará con el valor incrementando de 2, 4, 6, 8, 10, 2, 4, 6, 8, 10, etc.
+
=== Clasificación ===
 +
*<code>clear</code> borra la información de la consola.
 +
*<code>alias</code> hace una lista de los alias actuales.
 +
*<code>fov_desired (20-90)</code> establece el [[field of view/es|campo de visión]].
 +
*<code>viewmodel_fov </code> establece el campo de visión del modelo en primera persona. Su rango va de 54 a 70.
 +
*<code>r_drawviewmodel (0/1)</code> muestra (1) u oculta (0) el modelo del arma.
 +
*<code>lastdisguise</code> hace que el jugador se disfrace del último disfraz utilizado. <small>(solo Spy)</small>
 +
*<code>load_itempreset (0-3)</code> carga un equipamiento prestablecido [A, B, C, D].
 +
*<code>say message</code> envía un mensaje al chat público.
 +
*<code>say_team message</code> envía un mensaje al chat de equipo.
 +
*<code>say_party message</code> envía un mensaje al chat de grupo.
 +
*<code>+taunt</code> abre el equipamiento de burlas del persona.
 +
*<code>+use_action_slot_item</code> hace uso del espacio del objeto de acción.
 +
*<code>volume (0-1)</code> cambia el volumen del juego.
 +
*<code>taunt_by_name (name)</code> efectúa una burla específica, con el nombre exacto de la burla, sin abrir el menú de burlas.
  
Eso es un ejemplo de incrementvar en acción:
+
== Advanced Scripting Techniques ==
 +
=== Toggles ===
 +
It is possible to bind a key to toggle a command which would otherwise be a press and hold command.
  
:'''bind "n" "incrementvar net_graphpos 1 3 1"'''
+
<pre>bind w toggle_movement
 +
alias toggle_movement enable_movement
 +
alias enable_movement "alias toggle_movement disable_movement;+forward"
 +
alias disable_movement "alias toggle_movement enable_movement;-forward"</pre>
 +
This script will cause a press of {{key|W}} to keep the player moving forward until {{key|W}} is pressed again.
 +
 
 +
=== Key combinations ===
 +
It is possible to create a script where pressing one button while another is held down will change the action of the first button.
 +
 
 +
<pre>bind e call
 +
alias call Call_For_Medic
 +
alias Call_For_Medic "voicemenu 0 0"
 +
alias Call_For_Ubercharge "voicemenu 1 6"</pre>
 +
At this point, the script will mean that every time {{key|E}} is pressed, the player will call for a Medic. It also has an unused alias to call for an [[ÜberCharge]].
 +
<pre>bind shift +toggleState
 +
alias +toggleState "alias call Call_For_Ubercharge"
 +
alias -toggleState "alias call Call_For_Medic"</pre>
 +
Now, pressing {{Key|Shift}} will redirect <code>call</code> to ask for an ubercharge. Releasing {{Key|Shift}} will make <code>call</code> point back at a Medic call.
 +
When {{Key|Shift|E}} is pressed, the player will call for an Ubercharge, rather than for a Medic.
 +
If you want multiple key combination binds connected to the same toggle key you will have to repeat the first step listed before.
 +
<pre>bind f thank
 +
alias thank Thank_Player
 +
alias Thank_Player "voicemenu 0 1"
 +
alias Good_Work "voicemenu 2 7"</pre>
 +
After this add the same command as what happened in the second step, but alongside the already used command.
 +
<pre>bind shift +toggleState
 +
alias +toggleState "alias call Call_For_Ubercharge;alias thank Thank_Player"
 +
alias -toggleState "alias call Call_For_Medic;alias thank Good_Work"</pre>
 +
Overall the script should look like:
 +
<pre>bind e call
 +
alias call Call_For_Medic
 +
alias Call_For_Medic "voicemenu 0 0"
 +
alias Call_For_Ubercharge "voicemenu 1 6"
 +
 
 +
bind f thank
 +
alias thank Thank_Player
 +
alias Thank_Player "voicemenu 0 1"
 +
alias Good_Work "voicemenu 2 7"
  
Eso se une el tecla "N" a ciclar a el posición siguiente en los tres posiciones disponibles del comando net_graph.
+
bind shift +toggleState
 +
alias +toggleState "alias call Call_For_Ubercharge;alias thank Thank_Player"
 +
alias -toggleState "alias call Call_For_Medic;alias thank Good_Work"</pre>
  
==Los comandos + y -==
+
=== Wait-testing ===
 +
Since the <code>wait</code> command is integral to some scripts, it may be necessary to test to see if a server has disabled the command.
  
Esos comandos tienen dos estados. Mientras el tecle unido está presionado, el +comando ejecuta y se continua se ejecución.
+
<pre>alias waitTester "alias waitTest waitPositive;wait;waitTest"
 +
alias wait "alias waitTest waitNegative"
 +
alias waitPositive "echo Wait is enabled on this server.;exec waitPositive.cfg"
 +
alias waitNegative "echo Wait is DISABLED on this server!;exec waitNegative.cfg"
 +
waitTester</pre>
 +
This script relies on the fact that if the wait command is disabled on a server, the alias named <code>wait</code> can be defined by the user. Thus, the script creates an alias named <code>waitTest</code> which by default points to <code>waitPositive</code>, but if <code>wait</code> is not allowed (and can thus be defined by the user), will be redirected to <code>waitNegative</code>.
  
Por ejemplo:
+
=== Loops ===
:'''bind "c" "+duck"
+
:'''Warning: Loops which run without a wait command will cause the TF2 client to hang. It is highly suggested to run a looping script only after a wait testing script.'''
 +
It is generally considered bad form to have one alias point to itself, as although the loop can be broken out of, it cannot be reset. Therefore, looping scripts tend to include two parts to the loop: The part that waits, and the part that loops.
  
Eso +comando es unido a "c" y cada vez la tecla está presionado, el jugador agacha. Cada vez la tecla es suelta, +duck está cambió a -duck y el jugador no agacha.
+
<pre>bind g loopKey
 +
alias loopKey startLoop
 +
alias startLoop "alias loopKey stopLoop;+attack;alias redirect loop;loop"
 +
alias stopLoop "-attack;alias redirect;alias loopKey startLoop"
 +
alias loop "+left;wait 33;-left;+right;wait 33;-right;redirect"</pre>
  
En general, si el comando o alias es unido a una tecla, un + cuenta el juego ejecuta el comando mientras la tecla está presionado. En manera similar, si el comando está unido a una tecla, un - cuenta el juego ejecuta el comando cuando la tecla está suelta.
+
This script will start looping once {{Key|G}} is pressed. It begins by firing, and then switches the player's view back and forth every 33 frames (half of a second on most servers). Pressing {{Key|G}} would cause the next iteration of the loop to stop, also stopping the firing.
  
Si un alias está definido con una + en frente de lo, el alias estará ejecutar cada vez la tecla está presionado a el momento la tecla está presionado. El comando - estará ejecutar a el momento la tecla está suelta.
+
=== Sequences ===
 +
<pre>alias +pyrocombo "slot1;+attack;wait 32;slot2"
 +
alias -pyrocombo "-attack;slot1"</pre>
 +
This script will create two aliases, one to start a sequence, and one to end it. The sequence will switch to a Pyro's [[Degreaser]] and fire for 32 ticks, before switching to the [[Panic Attack]] and shooting until the button is no longer held. Sequences can also be made like this:
 +
<br><pre>alias quickscope "slot1;+attack2;wait 32;+attack;wait 16;-attack;-attack2"</pre>
 +
This script will create a sequence alias, that once activated will cause the Sniper to quick-scope his [[Sniper Rifle]]; by executing the long string of commands called a sequence.
 +
Sequences are useful in making scripts, and learning how to make one will help in the long run of scripting.
  
==Wait Command==
+
=== Cycles ===
 +
A cycle is toggle script where there are a minimum of 3 possible options, which loop (ex, 1, 2, 3, 1). Example:
 +
<pre>
 +
alias Fov_Cycle Fov1
 +
alias Fov1 "alias Fov_Cycle Fov2;fov_desired 70"
 +
alias Fov2 "alias Fov_Cycle Fov3;fov_desired 80"
 +
alias Fov3 "alias Fov_Cycle Fov1;fov_desired 90"
  
If you want the game to delay for a period of time during an alias, or if you want avoid client crashes caused by executing commands too quickly, use the '''wait''' command.
+
bind o Fov_Cycle
 +
</pre>
 +
This script makes it so pressing the {{Key|O}} key, FOV values switch between 70, 80, and 90.
  
Wait tells the game to delay the next command in the script by one physics frame, something like a full turn in the TF2 rules. It accepts values such as "wait 50" which tells the game to wait fifty frames before the alias continues. "wait 100" is roughly a second on a 100 FPS server.
+
=== Selection addons ===
 +
A selection script is built onto a cycle to make it more intuitive. Selection scripts allow cycling upwards and downwards, ultimately giving more control for selecting which command(s) to run.
 +
<pre>
 +
alias CondC_UP Cond1
 +
alias CondC_DOWN Cond5
 +
alias ApplyCond ApplyCond33
 +
alias ApplyCond33 "addcond 33"
 +
alias ApplyCond49 "addcond 49"
 +
alias ApplyCond72 "addcond 72"
 +
alias ApplyCond74 "addcond 74"
 +
alias ApplyCond90 "addcond 90"
 +
alias Cond1 "alias CondC_UP Cond2;alias CondC_DOWN Cond5;alias ApplyCond ApplyCond33"
 +
alias Cond2 "alias CondC_UP Cond3;alias CondC_DOWN Cond1;alias ApplyCond ApplyCond49"
 +
alias Cond3 "alias CondC_UP Cond4;alias CondC_DOWN Cond2;alias ApplyCond ApplyCond72"
 +
alias Cond4 "alias CondC_UP Cond5;alias CondC_DOWN Cond3;alias ApplyCond ApplyCond74"
 +
alias Cond5 "alias CondC_UP Cond1;alias CondC_DOWN Cond4;alias ApplyCond ApplyCond90"
 +
</pre>
 +
This gives more control in what conditions to add to the player. This also allows for better freedom of selection and ease of use, as it makes scrolling through options in the cycle possible.
  
Some servers disable the wait command. While playing on them, wait commands will be ignored, making some scripts susceptible to crashes. A script containing an indeterminate loop spaced by wait commands will always immediately hang upon usage on such servers.
+
=== Randomization ===
==Aliases==
+
Randomization is a strange and niche feature. Randomization is rarely used, as most processes aren't as useful when randomized. However, randomization can be useful for chat binds, such as for trade advertising.
  
An alias is like a variable that stores a series of commands which can be executed as a group. A simple alias will take the form:
+
'''Note: Due to the nature of TF2's scripting, this section will be considerably long. If you don't already have an understanding of how cycles work, the information presented may not be relevant.'''
 +
<pre>
 +
alias call f1
 +
alias cycle c2
  
'''alias "aliasname" "command1; command2; command3"'''
+
alias c1 "alias cycle c2;alias call f1"
 +
alias c2 "alias cycle c3;alias call f2"
 +
alias c3 "alias cycle c4;alias call f3"
 +
alias c4 "alias cycle c5;alias call f4"
 +
alias c5 "alias cycle c1;alias call f5"
  
You can then execute the commands through a bound key:
+
alias f1 "say 1"
 +
alias f2 "say 2"
 +
alias f3 "say 3"
 +
alias f4 "say 4"
 +
alias f5 "say 5"
  
'''bind "key" "aliasname"'''
+
alias +w "+forward;cycle"
 +
alias -w "-forward;cycle"
 +
alias +a "+moveleft;cycle"
 +
alias -a "-moveleft;cycle"
 +
alias +s "+back;cycle"
 +
alias -s "-back;cycle"
 +
alias +d "+moveright;cycle"
 +
alias -d "-moveright;cycle"
  
Whenever the key is pressed, command1, command2, and command3 are executed in order.
+
bind o call
 +
bind w +w
 +
bind a +a
 +
bind s +s
 +
bind d +d
 +
</pre>
 +
This script is assigning and resigning multiple alias values. When any of the {{key|WASD}} keys are pressed, the cycle command is ran, which moves the cycle command to the next value in the cycle and sets the "call" command to a value corresponding to the cycle number. This is based on the player's movement, and only changes values if the player is moving. It is possible to make this randomizer more effective by using other various techniques stated here (ex. Loops), but this example is for demonstration purposes only.
  
===Complex Aliases===
+
=== Timed action ===
 +
Timed or held actions trigger when a button is pressed down for a certain amount of time. Timed actions can be used in situations where a script or command shouldn't be instantly ran the moment a button is pressed (ex. accidentally pressing a disconnect bind).
  
Aliases can execute any command including other aliases.  Furthermore, an alias can execute an alias in order to redefine that alias's commands.  This allows you to create cycling aliases.  Here is a very simple example:
+
<pre>
 +
alias "+ti_zoom" "alias zoom_con zoomOn; wait 132; zoom_con"
 +
alias "-ti_zoom" "zoomOff; alias zoom_con ; rb_tizoom-M4"
 +
alias "rb_tizoom-M4" "unbind mouse4; wait 132; bind mouse4 +ti_zoom"
 +
alias "zoomOn" "fov_desired 20; r_drawviewmodel 0"
 +
alias "zoomOff" "fov_desired 90; r_drawviewmodel 1"
 +
bind "mouse4" "+ti_zoom"
 +
</pre>
  
'''bind "key" namescroll'''<br>
+
Pressing (and immediately releasing) {{key|Mouse 4}} with this script loaded will have no noticeable effect, however holding down {{key|Mouse 4}} for 2 seconds will cause the script to lower the FOV to 20, and hide viewmodels. Letting go of {{key|Mouse 4}} at any point will undo these changes by setting the FOV to 90 and unhiding viewmodels.
'''alias namescroll "firstname" '''<br>
 
'''alias firstname "setinfo name "First_name"; alias namescroll secondname" '''<br>
 
'''alias secondname "setinfo name "Second_name"; alias namescroll thirdname"'''<br>
 
'''alias thirdname "setinfo name "Third-name"; alias namescroll firstname"'''<br>
 
  
This is difficult to read, so break it down.
+
This works because of the use of + and - aliases. Pressing the key <code>+ti_zoom</code> is bound to will redefine <code>zoom_con</code> to activate the script, and if left pressed for the <code>wait</code> duration will execute the script. However, if the button is released, <code>zoom_con</code> is redefined to do nothing. The key is then "disabled" by being unbound for the same <code>wait</code> duration, and rebound afterwards to restore use of the key.
  
*The first line binds "key" to an alias "namescroll" which we have yet to define.
+
'''Note:''' Rebinding of the key is technically redundant, as the script will not execute the timed action if the button is unpressed. However, if the button is pressed multiple times it is possible to execute the timed action if the confirmation alias (in this case, <code>zoom_con</code> is properly defined as any of the presses would execute it. Unbinding the key for the same duraiton of the original <code>wait</code> delay ensures that the effect can't be triggered if the button is rapidly pressed.
*The second line creates the alias "namescroll" which executes the command "firstname"
 
*The third line defines the "firstname" alias as two commands:
 
:*The first command sets your in-game name to "First_name"
 
:*The second command redefines the alias "namescroll" as an alias for executing the alias "secondname"
 
*The fourth line defines "secondname" in the same manner.  A different in-game name is set, and then "namescroll" is redefined to another alias "thirdname"
 
*The fifth line defines "thirdname" just like the two before it, but with a twist. It redefines the "namescroll" alias as executing the "firstname" alias.
 
  
This completes a loop. Each press of the key executes a command and redefines the alias bound to the key, so that when it is next pressed it will execute a different command.  If there were no loop, then the alias "namescroll" wouldn't always have another alias to execute with each keypress.
+
=== Basic Conditionals ===
 +
The basic conditional allows a script to change its behavior without running an entirely new script. By making use of a dummy alias it is possible to change the outcome of an input based on other inputs. Basic conditionals can support potentially infinitely many checks on the state of other commands, however it's unlikely that a script would need more than a few checks per conditional.
  
===Alias Loops===
+
A very basic example of a conditional may look like:
Aliases can be used in conjunction with the Wait command to create looping aliases.<br>
+
<pre>
 +
alias "check_test" "check1; check2; test"
 +
alias "check1" ""
 +
alias "check2" ""
 +
alias "test" "success"
  
+
alias "fail_check" "alias test failure"
''Warning:Not having the wait in place, or being on a server with wait disabled will cause this example to crash TF2.''<br>
 
'''alias "Loop" "echo Looping every 150 ticks.;wait 150;Loop"'''<br>
 
'''Loop'''<br>
 
  
Lets break this down into components:<br>
+
alias "success" "echo SUCCESS!"
Line 1<br>
+
alias "failure" "alias test success; echo FAILURE!"
The echo displays a message to the console, just so you know it works.<br>
 
The wait makes it wait 150 ticks between iterations<br>
 
Loop calls the alias again, restarting at the echo.<br>
 
<br>
 
Line 2<br>
 
Loop starts the looping alias.<br>
 
  
You can also create loops of alias commands, like this example:<br>
+
alias "+k" "alias check1 fail_check"
'''alias "Loop1" "echo Loop 1;wait 150;Loop2"'''<br>
+
alias "-k" "alias check1"
'''alias "Loop2" "echo Loop 2;wait 150;Loop1"'''<br>
+
alias "+j" "alias check2 fail_check"
 +
alias "-j" "alias check2"
  
Loop1 calls Loop2 which in turn calls Loop1, etc...<br>
+
bind "l" "check_test"
This method can also be used for breaking a loop without clearing the loop alias:<br>
+
bind "j" "+j"
'''alias "Loop1" "echo Loop1;wait 150;Loop2"'''<br>
+
bind "k" "+k"
'''alias "Loop2" "Loop1"'''<br>
+
</pre>
This would create a loop, then<br>
 
'''alias "Loop2"'''<br>
 
would break it, by clearing the Loop2 alias.<br>
 
  
You can use these for button presses(Via the +/- prefixes covered earlier) like this:<br>
+
The main function of this script is the <code>check_test</code> alias. When ran, this alias checks the other 2 conditionals, and if the checks succeed it runs the <code>success</code> alias. However, if one of the checks fails, the dummy alias <code>test</code> is pointed to run the <code>failure</code> alias. Simply put, when a check succeeds the checking command doesn't redirect the alias <code>test</code> is pointing to. If a check fails, it redirects the <code>test</code> alias to the alias storing the code to run when the check fails.
'''alias "Loop2" "Loop1"'''<br>
 
'''alias "Loop1" "echo Loop1;wait 150;Loop2"'''<br>
 
'''alias "+Loop" "alias Loop2 Loop1;Loop2"'''<br>
 
'''alias "-Loop" "alias Loop2"'''<br>
 
'''bind "<Key>" "+Loop"'''<br>
 
In order of what it's doing:<br>
 
Make Loop2 point to Loop1<br>
 
Make Loop1 echo 'Loop1' to the console, wait 150, then call Loop2<br>
 
make +Loop point Loop2 to Loop1 and run Loop2<br>
 
make -Loop clear Loop2's link, breaking the loop<br>
 
  
== Useful Script Commands ==
+
In this case, pressing the button {{key|L}} without pressing either {{key|J}} or {{key|K}}, the check succeeds and prints <code>SUCCESS!</code> to the console. When pressing and holding either {{key|J}} or {{key|K}} and then pressing {{key|L}}, the check will fail and print <code>FAILURE!</code> to the console.
There are literally hundreds of different arguments for your script that can make them do almost anything. Here's a list of a few of them.
 
  
===Voice Commands===
+
A real world example of basic conditionals:
 +
<pre>
 +
// Change the crosshair color when moving around
  
Voice command is the act of making your class say something, this is often used in gameplay as a way of either signaling information or just for goofing-off.
+
alias "+w" "+forward; press_w"
 +
alias "+a" "+moveleft; press_a"
 +
alias "+s" "+back; press_s"
 +
alias "+d" "+moveright; press_d"
 +
alias "-w" "-forward; unpress_w"
 +
alias "-a" "-moveleft; unpress_a"
 +
alias "-s" "-back; unpress_s"
 +
alias "-d" "-moveright; unpress_d"
  
Voice commands are used with the following syntax;
+
alias "press_w" "alias check_w pressed_w; chc_forward"
 +
alias "press_a" "alias check_a pressed_a; chc_left"
 +
alias "press_s" "alias check_s pressed_s; chc_back"
 +
alias "press_d" "alias check_d pressed_d; chc_right"
 +
alias "unpress_w" "alias check_w unpressed; check_none"
 +
alias "unpress_a" "alias check_a unpressed; check_none"
 +
alias "unpress_s" "alias check_s unpressed; check_none"
 +
alias "unpress_d" "alias check_d unpressed; check_none"
  
'''voicemenu <menu_number> <phrase_number>
+
alias "check_w" "unpressed"
 +
alias "check_a" "unpressed"
 +
alias "check_s" "unpressed"
 +
alias "check_d" "unpressed"
  
Where <menu_number> is the one of the 3 menus where voice commands are spread out through <phrase_number> is one of the 7 voice commands that are within each <menu_number> menu.
+
alias "pressed_w" "dchk_fail; chc_forward"
 +
alias "pressed_a" "dchk_fail; chc_left"
 +
alias "pressed_s" "dchk_fail; chc_back"
 +
alias "pressed_d" "dchk_fail; chc_right"
 +
alias "unpressed" ""
  
====Arguments for voice commands====
+
alias "check_none" "check_s; check_a; check_d; check_w; dmy_check"
 +
alias "dmy_check" "chc_success"
  
*0 <phrase_number>
+
alias "dchk_fail" "alias dmy_check chc_failure"
*:0: Medic
+
alias "dchk_reset" "alias dmy_check chc_success"
*:1: Thanks
 
*:2: Go
 
*:3: Move Up
 
*:4: Flank Left
 
*:5: Flank Right
 
*:6: Yes
 
*:7: No
 
*1 <phrase_number>
 
*:0: Incoming
 
*:1: Cloaked Spy
 
*:2: Sentry Ahead
 
*:3: Teleporter Here
 
*:4: Dispenser Here
 
*:5: Sentry Here
 
*:6: Activate ÜberCharge
 
*:7: (Medic Only) ÜberCharge Ready
 
*2 <phrase_number>
 
*:0: Help
 
*:1: Battlecry
 
*:2: Cheers
 
*:3: Jeers
 
*:4: Positive
 
*:5: Negative
 
*:6: Nice Shot
 
*:7: Good Job
 
  
===Quick Spy disguises===
+
alias "chc_failure" "dchk_reset"
 +
alias "chc_success" "chc_default"
  
With these quick and easy commands, you can bind keys to specific disguises instead of having to flip through the disguise menu.
+
alias "chc_default" "color0"
 +
alias "chc_forward" "color1"
 +
alias "chc_left" "color2"
 +
alias "chc_back" "color3"
 +
alias "chc_right" "color4"
  
Disguise commands are used with the following syntax;
+
// Binds
 +
bind "w" "+w"
 +
bind "a" "+a"
 +
bind "s" "+s"
 +
bind "d" "+d"
  
'''disguise <class_number> <team_number>
+
// Colors
 +
alias "color0" "cl_crosshair_red 0; cl_crosshair_green 255; cl_crosshair_blue 0"        // Default color when not moving
 +
alias "color1" "cl_crosshair_red 0; cl_crosshair_green 0; cl_crosshair_blue 255"        // Color when moving forward
 +
alias "color2" "cl_crosshair_red 255; cl_crosshair_green 0; cl_crosshair_blue 255"      // Color when moving left
 +
alias "color3" "cl_crosshair_red 128; cl_crosshair_green 212; cl_crosshair_blue 255"    // Color when moving back
 +
alias "color4" "cl_crosshair_red 255; cl_crosshair_green 140; cl_crosshair_blue 25"    // Color when moving right
 +
</pre>
  
Where <class_number> is the number of the class you wish to disguise as, and <team_number> the number of the team you wish to disguise as.
+
This script will change the color of the user's crosshair as they walk around with the {{key|WASD}} keys. An important note this script takes advantage of is that when a check fails it can do several things instead of just changing the dummy command for testing. When a check fails the crosshair will change colors, and also change the dummy command to fail the check. This means when several buttons are unpressed, the crosshair's color will properly change to the most recently pressed key.
  
====Arguments for disguise commands====
+
== Commenting ==
 +
As scripts get longer, the need for well-named aliases grows. However, it is not always sufficient to explain what an alias does simply by its name. Adding a pair of forward slashes (//) will turn the rest of the line into a comment–it will not execute any actions on the text.
  
*1 <class_number>
+
<pre>voicemenu 1 6 //Activate Charge!</pre>
*:1: Scout
+
Since it is not obviously clear what the voice command is, a comment can explain it.
*:2: Sniper
 
*:3: Soldier
 
*:4: Demoman
 
*:5: Medic
 
*:6: Heavy
 
*:7: Pyro
 
*:8: Spy
 
*:9: Engineer
 
  
*2 <team_number>
+
==Scripts que destacan==
*:1: BLU team
+
Hay varios scripts que destacan por afectar al modo de juego. Algunos han sido parcheados, pero otros aun funcionan.
*:2: RED team
 
*:-1: Opposite team
 
*:-2: Same team
 
  
==Noteworthy scripts==  
+
=== Scripts parcheados ===
 +
==== Scripts de la pistola ====
 +
====Script de la Pistola====
 +
Originalmente la [[Pistol/es|Pistola]] daba un tiro por cada clic. Un usuario hizo un script que permitía mantener pulsado el clic para disparar.
  
There are several notable scripts that have affected gameplay.  Some of these are patched out.  Others remain functional.
+
{{Patch name|8|13|2009}}: Ahora la Pistola dispara a una velocidad fija, no depende de la velocidad con la que se haga clic.
  
===Patched Scripts===
+
====Script del giro del Escudo====
 +
Originalmente, los comandos de teclado para girar a izquierda y derecha no se consideraban igual que los comandos de ratón. El {{item link|Chargin' Targe}} fue la primera de las armas en crear una restricción sobre la velocidad de giro, por lo que Valve tuvo que limitar la velocidad del ratón. Sin embargo olvidaron aplicar el límite a los comandos de teclado para la misma acción. Se crearon scripts para controlar el giro durante la carga.
  
====Pistol Script====
+
{{Patch name|6|23|2011}}: Se corrigió un abuso de la mecánica del juego que permitía que el {{item name|Chargin' Targe}} tuviera más velocidad de giro.
  
Originally, the [[Pistol]] could be fired almost as fast as the human hand could press a key.  Realizing this, some people created scripts that made the Pistol fire as rapidly as possible as long as you held down the fire button.  This not only allowed the [[Scout]] and [[Engineer]] to fire faster than most people could manage, but it was easier to aim because you weren't mashing any keys.
+
==== Scripts de saltar y agacharse ====
 +
Originalmente, los jugadores pueden agacharse las veces que quieran durante un salto. Al asignar una tecla a agacharse y levantarse a la vez que se salta, se puede lograr ser menos accesible durante los saltos.
  
Valve eventually leveled the playing field.  They patched the Pistol to have a lower max firing rate, which was reached by default whenever a player held down the attack key.  The Pistol script was no longer necessary.
+
{{Patch name|3|6|2009}}: Ahora los jugadores solo se pueden agachar dos veces en el aire.
  
====Targe Turn Script====
+
==== Idling Scripts ====
 +
Most servers seek to prevent players idling for [[Item drop system|drops]]. Players can try to outsmart these systems with scripts that simulate basic movement.
  
Originally, the keyboard commands to turn your viewpoint left and right were not treated the same as the mouse commands.  The [[Chargin' Targe]] was the first weapon to create a restriction on how quickly you could turn your viewpoint, therefore Valve put a limit on mouse turn-speed but forgot to apply the same restriction to the keyboard command that resulted in the same action.
+
[http://www.teamfortress.com/post.php?id=11105 An Active Solution to an Idle Threat] requires players to accept a pop-up notification in order to continue to get drops.
  
Players made scripts that rebound keys whenever a player charged, allowing them to turn at full speed.  The most sophisticated examples temporarily rebound the mouse x-axis inputs to the keyboard turn commands, then unbound them when the player attacked at the end of the charge.
+
=== Scripts actuales ===
 +
====Scripts de ocultar arma====
 +
Hay gran cantidad de scripts que permiten pulsar una tecla para ocultar el modelo de las manos y el arma en primera persona. Esto puede resultar útil para tener visibilidad en puntos concretos. Aunque con el [[Spy/es|Spy]], por ejemplo, es necesario tener el modelo para ver la carga de invisibilidad del reloj o saber si se lleva el {{item link|Dead Ringer}} activado.
  
Valve eventually capped the keyboard turn commands as they did with the mouse commands, thus conferring no advantage to individuals who used the script.
+
==== Scripts de aumento ====
 +
Cambiando el [[FOV/es|campo de visión]], permite que un script haga efecto de zum con cualquier arma.
  
====Air Crouching Script====
+
==== Scripts de salto con arma centinela ====
 +
Desde la {{update link|Engineer Update}}, los Engineers pueden transportar sus [[Sentry Gun/es|armas centinela]]. Junto a esa característica se introdujo el {{item link|Wrangler}}, que permite al Engineer realizar [[Sentry jump/es|salto con arma centinela]] con los cohetes de la misma. Con comandos de entrada muy rápidos se puede realizar el salto y guardar la centinela para transportarla durante el salto.
  
Originally, you could crouch as many times as you liked in a single jump. By binding a script to crouch and uncrouch as rapidly as possible, you could exploit the engine and make it difficult to properly register shots on jumping targets.
+
El humano puede replicar esta acción, pero es muy complicado. Algunos jugadores han creado scripts para ejecutar los comandos en el orden específico para automatizar esta función.
 +
:''Nota:'' El {{item link|Rescue Ranger}} puede facilitarlo, ya que permite recoger [[buildings/es|construcciones]] a distancia por 100 de [[metal/es|metal]].
  
Valve patched it so you could only crouch twice in a single jump.
+
==== Scripts del Forajido ====
 +
Algunos jugadores no se encontraban satisfechos con la velocidad de construcción de la [[Combat Mini-Sentry/es|miniarma centinela]], por lo que desarrollaron un script con el que la pueden construir con un solo clic, sin necesidad de sacar la PDA.
  
===Current Scripts===
+
==== Scripts de sensibilidad y control ====
 +
Algunos jugadores prefieren unos controles o sensibilidades distintas para cada clase, variando de la velocidad del Scout en comparación con el Heavy o el Sniper al apuntar con el rifle. Algunos jugadores han hecho scripts con los que ajustan su sensibilidad con la clase deseada o incluso un arma específica.
  
====Weapon Hiding Scripts====
+
==== Charge Dash Scripts ====
 +
Since timing a charge and jump can be difficult, some players may use a quick script that binds the two actions to a button so that the charge dash will cover the maximum amount of distance possible. The player is still required to swing their melee weapon normally to end the charge though.
  
There are a large number of scripts which toggle the weapon display option depending on which weapon slot is selected for a class. Players often make their guns invisible to clear up the screen, but make items like Cuerpo a cuerpo weapons, PDAs, watches and so forth visible because these models indicate important information.  For example, the [[Spy]] relies heavily on his visible model to determine when he is cloaked, when his Cloak is disturbed, and when the [[Dead Ringer]] activates.  Other classes use the Cuerpo a cuerpo animations to judge when their attacks will hit.
+
==== Quickscope Scripts ====
 +
Many players find it difficult to scope in and fire straight after to get a quick headshot. There are scripts that will zoom in and fire just by clicking one button. This does require players to aim outside of the scope, though.
  
====Sentry Jumping Scripts====
+
==== Rocket Jump Scripts ====
 +
In order to [[Jumping#Soldier jumps|Rocket Jump]] to a maximum height or distance, it is required that the player jumps, crouches, and fires their rocket at roughly the same time. This can be easily scripted to occur with the press of a button.
  
Since the [[Engineer]] update, Engineers have been able to pack up and carry their [[Sentry Gun]]s.  Simultaneously, the [[Wrangler]] allowed Engineers to [[Sentry jump]] with their Sentry rockets. With extremely fast inputs, it was discovered that a player could Sentry jump and successfully pack up their Sentry before they were launched away.
+
==== Auto-Disguise Scripts ====
 +
For Spies who find manually disguising to be a hassle, this script automatically disguises as a chosen class after the player attacks with any weapon. Auto-disguise can usually be toggled and customized to choose a disguise to use.
  
While a human can repeat this feat, it's difficult and sometimes inconsistent. Some players made scripts which could reliably execute the commands in the right order at the right speed.  They can make a Sentry jump while carrying their Sentry every time.
+
==== ÜberCharge Broadcasting Scripts ====
 +
With this script, activating ÜberCharge as [[Medic]] will also write a custom message in team chat to alert your teammates about your activation, in order to encourage your team to push ahead with you. A similar script, upon activation, plays the "ÜberCharge Ready" voice command while writing in team chat that you faked your Über to fool the enemy team.
  
====Gunslinger Scripts====
+
==== Medic Radar ====
 +
This script only works for Medic, as it lets you press a button to temporarily set the autocall percentage to a very high number. This makes it so that you can see the locations of nearby teammates.
 +
Script:
 +
<pre>alias "autocall_default" "hud_medicautocallersthreshold 75.730003/Custom Threshold"
 +
alias "autocall_all" "hud_medicautocallersthreshold 150"
 +
alias "+radar" "autocall_all"
 +
alias "-radar" "autocall_default"
 +
bind [KEY] "+radar</pre>
  
Since it can be troublesome to destroy then rebuild a Combat Mini-Sentry in the heat of battle through the PDA, some players have scripted the destruction and rebuilding of their Mini-Sentry with the click of one or two mouse buttons.
+
==== Kill-Bind Scripts ====
 +
{{main|Suicide}}
 +
In certain circumstances, such as when cornered by a Medic wielding the [[Übersaw]], it can be beneficial for a class to be able to kill themselves quickly (in this case, to deny the Medic Über) with a key bind (for example, <code>bind k kill</code>). Although mostly only relevant in competitive play, there are occasional uses in public servers, often for comedic effect instead of to benefit gameplay. The killbind can be set to explode you if you use <code>explode</code> instead (for example, <code> bind k explode</code>). There is no difference between these two mechanically.
  
====Sensitivity and Control Scripts====
+
==== Null-Cancelling Movement Scripts ====
 +
In stock TF2, pressing two opposing movement keys at once (such as "A" (+moveleft) and "D" (+moveright)) will cancel all movement and render the player immobile, which can be a fatal mistake during battle. This script makes it so that the direction of the last key pressed will be used instead. For example, pressing "A" will make the player go left, and pressing "D" while still holding "A" will make the player go right instead of stopping.
  
Some players prefer different mouse sensitivities and control schemes for some classes (for example, changing from Scout, which requires high sensitivity for quick turning and maneuverbility, to Sniper, which encourages low sensitivity for precise aiming so a hand twitching inadvertently won't ruin your aim too much). These scripts alter their control schemes and mouse settings on a per class or even per weapon basis.
+
==== Chat Bind Scripts ====
 +
Chat bind scripts are designed to post a pre-written message in the in-game text chat. Typically, users will bind these scripts to a key on their keyboard for easy repitition. These scripts can vary from user-to-user, and can say anything within the text limit, depending on what a player would want to say. Some common binds are used for team co-ordination, such as a bind to tell a team that their Medic has popped an [[ÜberCharge]]. Other common binds are used for banter, such as messages upon kills and/or dominations. Another variation on this is a trade offer bind, where it sends information to the chat about a possible trade offer. This type of script can also be automated to send these offers every couple of minutes.
  
====Zoom Scripts====
+
==== Voice Toggle ====
 +
This script enables you to voice toggle, instead of push-to-talk.
 +
Script:
 +
<pre>bind [KEY] mic_toggle
 +
alias mic_toggle mic_enable
 +
alias mic_enable "+voicerecord; alias mic_toggle mic_disable"
 +
alias mic_disable "-voicerecord; alias mic_toggle mic_enable"</pre>
  
By temporarily changing field of view variables to a lower field of view, one can achieve a minor zooming effect. This can provide a minor precision and visibility advantage.
+
== Notas ==
 +
* Cada archivo de configuración se limita a un [[w:es:mebibyte|mebibyte]] (1,04858 MB) de información, dicha restricción se puede sortear [[#Comando «exec»|ejecutando]] otro archivo de configuración al final del primero.
  
==See Also==
+
==Veasé también==
* [[List of useful console commands]]
+
* [[List of useful console commands/es|Lista de comandos de consola útiles]]
 +
* {{vdc|List of TF2 console commands and variables}}
 +
* {{vdc|Command Line Options|Command Line Options}}
 +
* {{vdc|VScript}}
  
==External Links==
+
== Enlaces externos ==
 +
* [https://gamebanana.com/scripts/games/297 Cientos de scripts en Gamebanana]
 +
* [https://cfg.tf cfg.tf, web dedicada a configuración de Team Fortress 2]
  
*[http://forums.steampowered.com/forums/showthread.php?t=709568 Steam Users' Forums - TF2 Scripting Tutorial]. This covers the basics of scripting, using numerous useful, approachable examples.
+
[[Category:Customization/es]]
*[http://warriornation.net/Forum/showthread.php?t=568008 TF2 scripting tutorial - Warrior Nation Network]. This is a much more advanced article, which requires pre-requisite knowledge of the basic scripting syntax.
 
*[http://www.fpsbanana.com/scripts/games/297 FPSBanana.com - TF2 scripts]. Hundreds of scripting examples for TF2.
 

Latest revision as of 11:17, 2 May 2024

«
This thing ain't on auto-pilot, son!
El Engineer haciendo salto con arma centinela con un script.
»

Los scrips son parámetros de los archivos de configuración (.cfg) empleados principalmente para asignar teclas, combinaciones y alias, así como automatizar comportamientos complejos y secuencias de comandos de consola. A diferencia de los hacks, los scripts forman parte del código fuente de Team Fortress 2 y no están vetados por el VAC (sistema antitrampas de Valve). El uso de scripts varía desde una simple asignación de un comando a una tecla a alias para redefinir otras combinaciones. Toda combinación que se puede ejecutar mediante la creación de un script, se puede ejecutar sin él. El script simplemente facilita la realización de dicha acción en el fragor de la batalla.


Índice

Scripts de comandos

A continuación se muestra una lista de comandos sin uso, más allá de la elaboración de scripts, por lo que no influyen en la jugabilidad directamente.

Comando «bind»

Este comando es el más simple de todos. Hace que la tecla especificada ejecute la acción deseada. Dicha acción puede ser un ajuste, un comando o un script.

bind [TECLA] [COMANDO]

Se pueden usar comillas acotando la tecla y/o el comando, es algo opcional pero si el comando tiene espacios entre el valor y el comando será obligatorio el uso de las comillas para que la consola lo interprete adecuadamente. Un ejemplo sería «bind mouse1 "say texto"», donde las comillas acotan el comando «say», que envía el mensaje «texto», lo cual pertenece a un mismo comando.

bind [TECLA] "[COMANDO 1];[COMANDO 2];[COMANDO 3]"

Las comillas en la tecla son opcionales, pero en los comandos son obligatorias, si no la consola no los interpretará como comandos consecutivos.

Nota: El comando

say "texto"

es correcto, pero

bind <TECLA> "say "texto""

no lo es. Esto es porque la interpretación de las comillas es errónea y no es necesario que haya comillas entre comillas, ya que eso aborta el comando automáticamente.

Hay dos formas de asignar teclas:

bind e "voicemenu 0 0"

Este método hará que el jugador llame a un Medic al pulsar E.

bind w +forward

Este método hará que el jugador se desplace hacia delante al mantener W.

Comando «toggle»

Este comando permite alternar un ajuste entre dos o más valores.

toggle sv_cheats 0 1

Comando «bindtoggle»

Este comando funciona igual que el anterior, pero se asigna a una tecla.

bindtoggle o sv_cheats 0 1
Nota: Si no se especifica ningún valor, ambos comandos variarán entre 0 y 1 por defecto.

En ambos casos, hay que asegurarse de que los valores están fuera de las comillas ("ejemplo" 0 1).

Comando «incrementvar»

Este comando permite pasar por distintos valores de un comando.

bind MWHEELUP "incrementvar fov_desired 75 90 1"
bind MWHEELDOWN "incrementvar fov_desired 75 90 -1"
comando "<argumento1>" "incrementvar <argumento2> X Y Z"
  • X y Y representan el valor que se quiere ejecutar con <argumento2>.
  • Z es el salto que se hará de un valor a otro.

Si quieres que en un rango de 1-10 se vaya pasando de 2 en 2 valores, las siglas X Y Z equivaldrían a 1 10 2. Cada vez que se ejecute pasara por 2, 4, 6, 8, 10, 2, 4, 6, 8, 10, etc.

Esto es un ejemplo de incrementvar real:

bind "n" "incrementvar net_graphpos 1 3 1"

Esto hace que la tecla "n" haga pasar el net_graph por 1, 2, o 3.

Este ejemplo hará que el campo de visión aumenta al deslizar hacia arriba y disminuya al deslizar hacia abajo.

Nota: Un incrementvar se reiniciará si llega a un valor demasiado alto o pequeño. Es decir, si el campo de visión llega a 90, al seguir aumentándolo el siguiente punto volverá a 75, que es el punto más bajo, y viceversa.

Alias

Un alias permite ejecutar varios comandos referenciados en un mismo comando. Esto se puede considerar como un atajo y es útil cuando es necesario efectuar una serie de comandos en repetidas ocasiones.

Nota: Los nombres de los alias no pueden contener espacios. Pueden contener barras bajas, números y símbolos. Además distinguen entre mayúsculas y minúsculas.
alias Llamar_al_Medic "Voicemenu 0 0"
bind "e" "Llamar_al_Medic"

Esto funcionaría igual que asignar un comando con «bind», pero advirtiendo al juego de que el comando (o conjunto de comandos) es «Llamar_al_Medic».

Nota: Un alias puede tener el símbolo + frente a él (por ejemplo: +Diagonal), de esta manera posteriormente ejecutará su versión en - (en este caso: -Diagonal). Esto es útil para asignar movimientos.
alias "+Diagonal" "+moveleft; +back"
alias "-Diagonal" "-moveleft; -back"
bind "z" "+Diagonal"

Esto permite al jugador moverse diagonalmente. Al pulsar Z el jugador se moverá diagonalmente, hacia atrás y a la izquierda.

Aviso: ¡El siguiente código no funcionará!
bind "z" "+moveleft; +back"

Sin embargo, al pulsar Z el jugador se moverá hacia atrás y a la izquierda, el motor del juego no invierte el comando «+back» ya que sería un segundo comando y al soltar Z no haría que el jugador dejase de caminar hacia atrás.

Comando «exec»

Este comando ejecutará otro archivo. Esto significa que los scripts complejos se puede almacenar en otros archivos, sin ocupar espacio en los generales.

exec autoexec.cfg

Este script ejecutará el script «autoexec» del jugador.

Comando «echo»

Este comando mostrará texto en la consola. Es útil para acciones de depuración.

echo Los scripts son; echo muy útiles.

Esto mostrará en la consola Los scripts son y muy útiles. en dos líneas separadas. Esto es debido a que una nueva línea se añade al final de cualquier texto con echo. Los espacios se analizan si están entre dos palabras, o si el texto con «echo» está entre comillas, como en el siguiente ejemplo:

echo " Los scripts son muy útiles.   "

Los espacios adicionales se mostrarán, ya que la frase está delimitada por las comillas.

Nota: No es posible mostrar el carácter de las comillas ("), ya que su significado quedaría sin interpretación. Pero sí se puede reproducir una sola comilla (') o las comillas españolas (« »), preferiblemente.
Nota: El comando echo puede fallar con textos que no estén delimitados por comillas. Por ello, siempre es preferible acotarlo con comillas, haciéndolo más fácil de entender tanto para la consola como para los humanos.

Comando «wait»

Este comando hará que el juego espere un número de fotogramas hasta ejecutar el siguiente comando.

Aviso: Los comandos de espera están desactivados en algunos servidores. Esto hará que algunos scripts fallen e incluso puede causar (en algunos casos medi raros) que el juego se cuelgue. Véase Pruebas con «wait» para saber cómo proceder.
echo ¿Por qué cruzó la gallina la carretera?;wait 300;echo ¡Para cambiarse de acera!

Este script esperará 300 fotogramas (unos segundos) antes de enviar la segunda línea.

Archivos CFG de clase

Al cambiar a ciertas clases, el juego ejecuta los archivos CFG correspondientes (si los hubiera), con el nombre de la clase escogida.

scout.cfg
soldier.cfg
pyro.cfg
demoman.cfg
heavyweapons.cfg
engineer.cfg
medic.cfg
sniper.cfg
spy.cfg

Esta automatización permite al jugador tener varias asignaciones y ajustes para cada clase.

Opciones de lanzamiento

Las opciones de lanzamiento se pueden usar para alterar la forma en la que TF2 se ejecuta. Ya sea en cuanto a rendimiento o a funcionalidades. Véase Opciones de línea de comandos en la Comunidad de Desarrolladores de Valve para una lista de las opciones de lanzamiento.

Establecer opciones de lanzamiento

Una guía visual sobre cómo establecer opciones de lanzamiento (indicado en círculos rojos).
  1. Haz clic derecho en el título del juego en Biblioteca en Steam y selecciona Propiedades.
  2. En la pestaña General haz clic en el botón Establecer opciones de lanzamiento....
  3. Pon las opciones de lanzamiento que quieras aplicar (asegúrate de separar los códigos con espacios) y haz clic en Aceptar.
  4. Cierra la ventana de Propiedades e inicia el juego.

Opciones de ventana

Esto puede configurarse de forma incorrecta y reducir el rendimiento. Si es posible, es recomendable usar ajustes.

Resolución

Opción de lanzamiento: -w # -h #

Descripción: Fuerza la resolución de ancho y alto en píxeles.

Tasa de refresco

Opción de lanzamiento: -freq #

Descripción: Fuerza la tasa de refresco en hercios.

Modo ventana

Opción de lanzamiento: -windowed

Descripción: Inicia el juego en modo ventana.

Modo ventana sin bordes

Opción de lanzamiento: -noborder

Descripción: Una vez en modo ventana, se pueden eliminar los bordes, para tenerlo pantalla completa sin bordes. En oposición al modo de pantalla completa.

Modo pantalla completa

Opción de lanzamiento: -fullscreen

Descripción: Fuerza la resolución del juego en ancho y alto en píxeles.

Soporte periférico

Desactivar joystick

Opción de lanzamiento: -nojoy

Descripción: Evita que el sistema cargue la compatibilidad con joystick, mejora el tiempo de inicio y minimiza el uso de memoria. No lo uses si sueles utilizar un mando.

Desactivar Steam Controller

Opción de lanzamiento: -nosteamcontroller

Descripción: Evita que el sistema cargue la compatibilidad con Steam Controller, mejora el tiempo de inicio y minimiza el uso de memoria. No lo uses si sueles utilizar el mando de Steam.

Soporte de software

Desactivar SourceTV

Opción de lanzamiento: -nohltv

Descripción: Desactiva el soporte de SourceTV, minimizando el uso de memoria. No lo uses si sueles usar SourceTV en tu cliente.

Desactivar QuickTime

Opción de lanzamiento: -noquicktime

Descripción: Desactiva el soporte de QuickTime, minimizando el uso de memoria. No lo uses si sueles usar QuickTime o exportar archivos .MOV.

Opciones de motor

Desactivar vídeo introductorio

Opción de lanzamiento: -novid

Descripción: Elimina la introducción de Valve al iniciar el juego, mejorando el tiempo de carga.

Cambiar límite de partículas

Opción de lanzamiento: -particles #

Descripción: Limita el número de partículas. Establece # a «1» a (un límite de 512) para mejorar el uso de memoria.

Renderizado de fuente del precaché

Opción de lanzamiento: -precachefontchars

Descripción: Renderiza la fuente del precaché de algunos caracteres, mejorando los tiempos de renderizado.

Desactivar retransmisión de texutras

Opción de lanzamiento: -no_texture_stream

Descripción: Desactiva las carga de texturas de alta calidad, usando otras más modestas. Al desactivarlo se mejorará el rendimiento en sistemas con gráficos más moderados.

Versión de DirectX (exclusivo de Windows)

Opción de lanzamiento: -dxlevel #

Descripción: Establece la versión DirectX del juego; acepta todos los valores, pero solo son efectivos entre 81 y 100.
«-dxlevel 100» usa DirectX 9 y Pixel Shader 3.0. El hardware determina las capacidades gráficas.
«-dxlevel 81» es la versión más estable de DirectX 8 y usa Pixel Shader 1.1. Tiene más rendimiento que las versiones DirectX 9.
Nota: Al iniciar el juego, este se cerrará y se eliminará la opción de lanzamiento para establecer los archivos de configuración relacionados.

Lista de nombres de tecla

Pasa el ratón sobre una tecla para ver el nombre del script. No distingue entre mayúscula y minúscula.

ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12

`   1 2 3 4 5 6 7 8 9 0 - = ← Retroceso

Tab ⇆ Q W E R T Y U I O P [ ] \      

⇪ Bloq Mayús A S D F G H J K L Ñ '   Entrar ↵

Mayús     Z X C V B N M ,   .   /   Mayús        

Ctrl   Alt       Espacio       Alt Menú Ctrl    

Impr pant Bloq Despl Pausa

Insert   Inicio Av pág

Suprimir   Fin   Re pág


                 

         

Num / * -
7 8 9 +
4 5 6
1 2 3
    0     .
Botones de ratón Nombre del botón
Deslizar arriba MWHEELUP
Deslizar abajo MWHEELDOWN
Clic izquierdo MOUSE1
Clic derecho MOUSE2
Clic de la rueda MOUSE3
Clic lateral del ratón 1 MOUSE4
Clic lateral del ratón 2 MOUSE5

Comandos útiles

Artículo principal: Lista de variables y comandos de consola de TF2

Disfraces

El comando disguise tiene dos composiciones, el primero es la clase y el segundo el equipo.

Clase
1. Scout
2. Sniper
3. Soldier
4. Demoman
5. Medic
6. Heavy
7. Pyro
8. Spy
9. Engineer
Equipo
1. BLU
2. RED
-1. Equipo contrario
-2. Mismo equipo

De esta manera, disguise 5 1 disfrazaría de Medic BLU y disguise 7 -2 de Pyro amigo.

Nota: disguise 8 -2 (Spy amigo) hará que se desdisfrace.

Construcciones

Los comandos build y destroy tienen dos composiciones, el primero es la construcción y el segundo el tipo de construcción.

El comando build saca el plano de la construcción.

build 0 0 construye un dispensador (solo Engineer)
build 1 0 construye una entrada de teleportador (solo Engineer)
build 1 1 construye una salida de teleportador (solo Engineer)
build 2 0 construye un arma centinela (solo Engineer)
build 3 0 pone un Zapador (solo Spy)

Del mismo modo, destroy destruirá construcciones.

destroy 0 0 destruirá un dispensador (solo Engineer)
destroy 1 0 destruirá una entrada de teleportador (solo Engineer)
destroy 1 1 destruirá una salida de teleportador (solo Engineer)
destroy 2 0 destruirá un arma centinela (solo Engineer)
Nota: Los Zapadores no se destruyen con comando.

Se pueden usar comandos build antiguos, que solo tienen una composición.

build 0 construirá un dispensador (solo Engineer)
build 1 construirá un teleportador de entrada (solo Engineer)
build 2 construirá un arma centinela (solo Engineer)
build 3 construirá un teleportador de salida (solo Engineer)
build 3 pondrá un Zapador (solo Spy) [fuera de uso]

Menú de voz

El comando voicemenu tiene dos argumentos, el número del menú y del comando.

  • voicemenu 0
    0: ¡MEDIC!
    1: ¡Gracias!
    2: ¡Vamos! ¡Vamos! ¡Vamos!
    3: ¡Moveos!
    4: A la izquierda.
    5: A la derecha.
    6: Sí.
    7: No.
    8: ¡Pásamela!
  • voicemenu 1
    0: Adelante.
    1: ¡Spy!
    2: ¡Centinela al frente!
    3: Teleportador aquí.
    4: Dispensador aquí.
    5: Centinela aquí.
    6: ¡Activa la carga!
    7: MEDIC: Supercarga lista.
    8: ¡Pásamela!
  • voicemenu 2
    0: ¡Ayuda!
    1: Grito de guerra.
    2: Aplausos.
    3: Ovación.
    4: Positivo.
    5: Negativo.
    6: Buen disparo.
    7: Buen trabajo.
Nota: Si quieres abrir el menú de voz en vez de emitir el mensaje voicemenu <núm> <núm>, el comando es voice_menu_<num>: donde <núm> es un número del 1 al 3. Del otro modo, para ver el primer menú de voz, el comando es voice_menu_1.

Teleporte Eureka

El comando eureka_teleport teleporta a un Engineer con el Efecto Eureka a su base o salida del teleportador si la hay.

  • eureka_teleport 0 teleportará al jugador a su base.
  • eureka_teleport 1 teleportará al jugador a su teleportador de salida.

El jugador verá «Unknown command» en la consola aunque funcione.

Clasificación

  • clear borra la información de la consola.
  • alias hace una lista de los alias actuales.
  • fov_desired (20-90) establece el campo de visión.
  • viewmodel_fov establece el campo de visión del modelo en primera persona. Su rango va de 54 a 70.
  • r_drawviewmodel (0/1) muestra (1) u oculta (0) el modelo del arma.
  • lastdisguise hace que el jugador se disfrace del último disfraz utilizado. (solo Spy)
  • load_itempreset (0-3) carga un equipamiento prestablecido [A, B, C, D].
  • say message envía un mensaje al chat público.
  • say_team message envía un mensaje al chat de equipo.
  • say_party message envía un mensaje al chat de grupo.
  • +taunt abre el equipamiento de burlas del persona.
  • +use_action_slot_item hace uso del espacio del objeto de acción.
  • volume (0-1) cambia el volumen del juego.
  • taunt_by_name (name) efectúa una burla específica, con el nombre exacto de la burla, sin abrir el menú de burlas.

Advanced Scripting Techniques

Toggles

It is possible to bind a key to toggle a command which would otherwise be a press and hold command.

bind w toggle_movement
alias toggle_movement enable_movement
alias enable_movement "alias toggle_movement disable_movement;+forward"
alias disable_movement "alias toggle_movement enable_movement;-forward"

This script will cause a press of W to keep the player moving forward until W is pressed again.

Key combinations

It is possible to create a script where pressing one button while another is held down will change the action of the first button.

bind e call
alias call Call_For_Medic
alias Call_For_Medic "voicemenu 0 0"
alias Call_For_Ubercharge "voicemenu 1 6"

At this point, the script will mean that every time E is pressed, the player will call for a Medic. It also has an unused alias to call for an ÜberCharge.

bind shift +toggleState
alias +toggleState "alias call Call_For_Ubercharge"
alias -toggleState "alias call Call_For_Medic"

Now, pressing ⇧ Shift will redirect call to ask for an ubercharge. Releasing ⇧ Shift will make call point back at a Medic call. When ⇧ Shift+E is pressed, the player will call for an Ubercharge, rather than for a Medic. If you want multiple key combination binds connected to the same toggle key you will have to repeat the first step listed before.

bind f thank
alias thank Thank_Player
alias Thank_Player "voicemenu 0 1"
alias Good_Work "voicemenu 2 7"

After this add the same command as what happened in the second step, but alongside the already used command.

bind shift +toggleState
alias +toggleState "alias call Call_For_Ubercharge;alias thank Thank_Player"
alias -toggleState "alias call Call_For_Medic;alias thank Good_Work"

Overall the script should look like:

bind e call
alias call Call_For_Medic
alias Call_For_Medic "voicemenu 0 0"
alias Call_For_Ubercharge "voicemenu 1 6"

bind f thank
alias thank Thank_Player
alias Thank_Player "voicemenu 0 1"
alias Good_Work "voicemenu 2 7"

bind shift +toggleState
alias +toggleState "alias call Call_For_Ubercharge;alias thank Thank_Player"
alias -toggleState "alias call Call_For_Medic;alias thank Good_Work"

Wait-testing

Since the wait command is integral to some scripts, it may be necessary to test to see if a server has disabled the command.

alias waitTester "alias waitTest waitPositive;wait;waitTest"
alias wait "alias waitTest waitNegative"
alias waitPositive "echo Wait is enabled on this server.;exec waitPositive.cfg"
alias waitNegative "echo Wait is DISABLED on this server!;exec waitNegative.cfg"
waitTester

This script relies on the fact that if the wait command is disabled on a server, the alias named wait can be defined by the user. Thus, the script creates an alias named waitTest which by default points to waitPositive, but if wait is not allowed (and can thus be defined by the user), will be redirected to waitNegative.

Loops

Warning: Loops which run without a wait command will cause the TF2 client to hang. It is highly suggested to run a looping script only after a wait testing script.

It is generally considered bad form to have one alias point to itself, as although the loop can be broken out of, it cannot be reset. Therefore, looping scripts tend to include two parts to the loop: The part that waits, and the part that loops.

bind g loopKey
alias loopKey startLoop
alias startLoop "alias loopKey stopLoop;+attack;alias redirect loop;loop"
alias stopLoop "-attack;alias redirect;alias loopKey startLoop"
alias loop "+left;wait 33;-left;+right;wait 33;-right;redirect"

This script will start looping once G is pressed. It begins by firing, and then switches the player's view back and forth every 33 frames (half of a second on most servers). Pressing G would cause the next iteration of the loop to stop, also stopping the firing.

Sequences

alias +pyrocombo "slot1;+attack;wait 32;slot2"
alias -pyrocombo "-attack;slot1"

This script will create two aliases, one to start a sequence, and one to end it. The sequence will switch to a Pyro's Degreaser and fire for 32 ticks, before switching to the Panic Attack and shooting until the button is no longer held. Sequences can also be made like this:


alias quickscope "slot1;+attack2;wait 32;+attack;wait 16;-attack;-attack2"

This script will create a sequence alias, that once activated will cause the Sniper to quick-scope his Sniper Rifle; by executing the long string of commands called a sequence. Sequences are useful in making scripts, and learning how to make one will help in the long run of scripting.

Cycles

A cycle is toggle script where there are a minimum of 3 possible options, which loop (ex, 1, 2, 3, 1). Example:

alias Fov_Cycle Fov1
alias Fov1 "alias Fov_Cycle Fov2;fov_desired 70"
alias Fov2 "alias Fov_Cycle Fov3;fov_desired 80"
alias Fov3 "alias Fov_Cycle Fov1;fov_desired 90"

bind o Fov_Cycle

This script makes it so pressing the O key, FOV values switch between 70, 80, and 90.

Selection addons

A selection script is built onto a cycle to make it more intuitive. Selection scripts allow cycling upwards and downwards, ultimately giving more control for selecting which command(s) to run.

alias CondC_UP Cond1
alias CondC_DOWN Cond5
alias ApplyCond ApplyCond33
alias ApplyCond33 "addcond 33"
alias ApplyCond49 "addcond 49"
alias ApplyCond72 "addcond 72"
alias ApplyCond74 "addcond 74"
alias ApplyCond90 "addcond 90"
alias Cond1 "alias CondC_UP Cond2;alias CondC_DOWN Cond5;alias ApplyCond ApplyCond33"
alias Cond2 "alias CondC_UP Cond3;alias CondC_DOWN Cond1;alias ApplyCond ApplyCond49"
alias Cond3 "alias CondC_UP Cond4;alias CondC_DOWN Cond2;alias ApplyCond ApplyCond72"
alias Cond4 "alias CondC_UP Cond5;alias CondC_DOWN Cond3;alias ApplyCond ApplyCond74"
alias Cond5 "alias CondC_UP Cond1;alias CondC_DOWN Cond4;alias ApplyCond ApplyCond90"

This gives more control in what conditions to add to the player. This also allows for better freedom of selection and ease of use, as it makes scrolling through options in the cycle possible.

Randomization

Randomization is a strange and niche feature. Randomization is rarely used, as most processes aren't as useful when randomized. However, randomization can be useful for chat binds, such as for trade advertising.

Note: Due to the nature of TF2's scripting, this section will be considerably long. If you don't already have an understanding of how cycles work, the information presented may not be relevant.

alias call f1
alias cycle c2

alias c1 "alias cycle c2;alias call f1"
alias c2 "alias cycle c3;alias call f2"
alias c3 "alias cycle c4;alias call f3"
alias c4 "alias cycle c5;alias call f4"
alias c5 "alias cycle c1;alias call f5"

alias f1 "say 1"
alias f2 "say 2"
alias f3 "say 3"
alias f4 "say 4"
alias f5 "say 5"

alias +w "+forward;cycle"
alias -w "-forward;cycle"
alias +a "+moveleft;cycle"
alias -a "-moveleft;cycle"
alias +s "+back;cycle"
alias -s "-back;cycle"
alias +d "+moveright;cycle"
alias -d "-moveright;cycle"

bind o call
bind w +w
bind a +a
bind s +s
bind d +d

This script is assigning and resigning multiple alias values. When any of the WASD keys are pressed, the cycle command is ran, which moves the cycle command to the next value in the cycle and sets the "call" command to a value corresponding to the cycle number. This is based on the player's movement, and only changes values if the player is moving. It is possible to make this randomizer more effective by using other various techniques stated here (ex. Loops), but this example is for demonstration purposes only.

Timed action

Timed or held actions trigger when a button is pressed down for a certain amount of time. Timed actions can be used in situations where a script or command shouldn't be instantly ran the moment a button is pressed (ex. accidentally pressing a disconnect bind).

alias "+ti_zoom" "alias zoom_con zoomOn; wait 132; zoom_con"
alias "-ti_zoom" "zoomOff; alias zoom_con ; rb_tizoom-M4"
alias "rb_tizoom-M4" "unbind mouse4; wait 132; bind mouse4 +ti_zoom"
alias "zoomOn" "fov_desired 20; r_drawviewmodel 0"
alias "zoomOff" "fov_desired 90; r_drawviewmodel 1"
bind "mouse4" "+ti_zoom"

Pressing (and immediately releasing) Mouse 4 with this script loaded will have no noticeable effect, however holding down Mouse 4 for 2 seconds will cause the script to lower the FOV to 20, and hide viewmodels. Letting go of Mouse 4 at any point will undo these changes by setting the FOV to 90 and unhiding viewmodels.

This works because of the use of + and - aliases. Pressing the key +ti_zoom is bound to will redefine zoom_con to activate the script, and if left pressed for the wait duration will execute the script. However, if the button is released, zoom_con is redefined to do nothing. The key is then "disabled" by being unbound for the same wait duration, and rebound afterwards to restore use of the key.

Note: Rebinding of the key is technically redundant, as the script will not execute the timed action if the button is unpressed. However, if the button is pressed multiple times it is possible to execute the timed action if the confirmation alias (in this case, zoom_con is properly defined as any of the presses would execute it. Unbinding the key for the same duraiton of the original wait delay ensures that the effect can't be triggered if the button is rapidly pressed.

Basic Conditionals

The basic conditional allows a script to change its behavior without running an entirely new script. By making use of a dummy alias it is possible to change the outcome of an input based on other inputs. Basic conditionals can support potentially infinitely many checks on the state of other commands, however it's unlikely that a script would need more than a few checks per conditional.

A very basic example of a conditional may look like:

alias "check_test" "check1; check2; test"
alias "check1" ""
alias "check2" ""
alias "test" "success"

alias "fail_check" "alias test failure"

alias "success" "echo SUCCESS!"
alias "failure" "alias test success; echo FAILURE!"

alias "+k" "alias check1 fail_check"
alias "-k" "alias check1"
alias "+j" "alias check2 fail_check"
alias "-j" "alias check2"

bind "l" "check_test"
bind "j" "+j"
bind "k" "+k"

The main function of this script is the check_test alias. When ran, this alias checks the other 2 conditionals, and if the checks succeed it runs the success alias. However, if one of the checks fails, the dummy alias test is pointed to run the failure alias. Simply put, when a check succeeds the checking command doesn't redirect the alias test is pointing to. If a check fails, it redirects the test alias to the alias storing the code to run when the check fails.

In this case, pressing the button L without pressing either J or K, the check succeeds and prints SUCCESS! to the console. When pressing and holding either J or K and then pressing L, the check will fail and print FAILURE! to the console.

A real world example of basic conditionals:

// Change the crosshair color when moving around

alias "+w" "+forward; press_w"
alias "+a" "+moveleft; press_a"
alias "+s" "+back; press_s"
alias "+d" "+moveright; press_d"
alias "-w" "-forward; unpress_w"
alias "-a" "-moveleft; unpress_a"
alias "-s" "-back; unpress_s"
alias "-d" "-moveright; unpress_d"

alias "press_w" "alias check_w pressed_w; chc_forward"
alias "press_a" "alias check_a pressed_a; chc_left"
alias "press_s" "alias check_s pressed_s; chc_back"
alias "press_d" "alias check_d pressed_d; chc_right"
alias "unpress_w" "alias check_w unpressed; check_none"
alias "unpress_a" "alias check_a unpressed; check_none"
alias "unpress_s" "alias check_s unpressed; check_none"
alias "unpress_d" "alias check_d unpressed; check_none"

alias "check_w" "unpressed"
alias "check_a" "unpressed"
alias "check_s" "unpressed"
alias "check_d" "unpressed"

alias "pressed_w" "dchk_fail; chc_forward"
alias "pressed_a" "dchk_fail; chc_left"
alias "pressed_s" "dchk_fail; chc_back"
alias "pressed_d" "dchk_fail; chc_right"
alias "unpressed" ""

alias "check_none" "check_s; check_a; check_d; check_w; dmy_check"
alias "dmy_check" "chc_success"

alias "dchk_fail" "alias dmy_check chc_failure"
alias "dchk_reset" "alias dmy_check chc_success"

alias "chc_failure" "dchk_reset"
alias "chc_success" "chc_default"

alias "chc_default" "color0"
alias "chc_forward" "color1"
alias "chc_left" "color2"
alias "chc_back" "color3"
alias "chc_right" "color4"

// Binds
bind "w" "+w"
bind "a" "+a"
bind "s" "+s"
bind "d" "+d"

// Colors
alias "color0" "cl_crosshair_red 0; cl_crosshair_green 255; cl_crosshair_blue 0"        // Default color when not moving
alias "color1" "cl_crosshair_red 0; cl_crosshair_green 0; cl_crosshair_blue 255"        // Color when moving forward
alias "color2" "cl_crosshair_red 255; cl_crosshair_green 0; cl_crosshair_blue 255"      // Color when moving left
alias "color3" "cl_crosshair_red 128; cl_crosshair_green 212; cl_crosshair_blue 255"    // Color when moving back
alias "color4" "cl_crosshair_red 255; cl_crosshair_green 140; cl_crosshair_blue 25"     // Color when moving right

This script will change the color of the user's crosshair as they walk around with the WASD keys. An important note this script takes advantage of is that when a check fails it can do several things instead of just changing the dummy command for testing. When a check fails the crosshair will change colors, and also change the dummy command to fail the check. This means when several buttons are unpressed, the crosshair's color will properly change to the most recently pressed key.

Commenting

As scripts get longer, the need for well-named aliases grows. However, it is not always sufficient to explain what an alias does simply by its name. Adding a pair of forward slashes (//) will turn the rest of the line into a comment–it will not execute any actions on the text.

voicemenu 1 6 //Activate Charge!

Since it is not obviously clear what the voice command is, a comment can explain it.

Scripts que destacan

Hay varios scripts que destacan por afectar al modo de juego. Algunos han sido parcheados, pero otros aun funcionan.

Scripts parcheados

Scripts de la pistola

Script de la Pistola

Originalmente la Pistola daba un tiro por cada clic. Un usuario hizo un script que permitía mantener pulsado el clic para disparar.

Parche del 13 de agosto de 2009: Ahora la Pistola dispara a una velocidad fija, no depende de la velocidad con la que se haga clic.

Script del giro del Escudo

Originalmente, los comandos de teclado para girar a izquierda y derecha no se consideraban igual que los comandos de ratón. El Targe de Carga fue la primera de las armas en crear una restricción sobre la velocidad de giro, por lo que Valve tuvo que limitar la velocidad del ratón. Sin embargo olvidaron aplicar el límite a los comandos de teclado para la misma acción. Se crearon scripts para controlar el giro durante la carga.

Parche del 23 de junio de 2011: Se corrigió un abuso de la mecánica del juego que permitía que el Targe de Carga tuviera más velocidad de giro.

Scripts de saltar y agacharse

Originalmente, los jugadores pueden agacharse las veces que quieran durante un salto. Al asignar una tecla a agacharse y levantarse a la vez que se salta, se puede lograr ser menos accesible durante los saltos.

Parche del 6 de marzo de 2009: Ahora los jugadores solo se pueden agachar dos veces en el aire.

Idling Scripts

Most servers seek to prevent players idling for drops. Players can try to outsmart these systems with scripts that simulate basic movement.

An Active Solution to an Idle Threat requires players to accept a pop-up notification in order to continue to get drops.

Scripts actuales

Scripts de ocultar arma

Hay gran cantidad de scripts que permiten pulsar una tecla para ocultar el modelo de las manos y el arma en primera persona. Esto puede resultar útil para tener visibilidad en puntos concretos. Aunque con el Spy, por ejemplo, es necesario tener el modelo para ver la carga de invisibilidad del reloj o saber si se lleva el Duplicante activado.

Scripts de aumento

Cambiando el campo de visión, permite que un script haga efecto de zum con cualquier arma.

Scripts de salto con arma centinela

Desde la Actualización del Engineer, los Engineers pueden transportar sus armas centinela. Junto a esa característica se introdujo el Arreo, que permite al Engineer realizar salto con arma centinela con los cohetes de la misma. Con comandos de entrada muy rápidos se puede realizar el salto y guardar la centinela para transportarla durante el salto.

El humano puede replicar esta acción, pero es muy complicado. Algunos jugadores han creado scripts para ejecutar los comandos en el orden específico para automatizar esta función.

Nota: El Rescatadora puede facilitarlo, ya que permite recoger construcciones a distancia por 100 de metal.

Scripts del Forajido

Algunos jugadores no se encontraban satisfechos con la velocidad de construcción de la miniarma centinela, por lo que desarrollaron un script con el que la pueden construir con un solo clic, sin necesidad de sacar la PDA.

Scripts de sensibilidad y control

Algunos jugadores prefieren unos controles o sensibilidades distintas para cada clase, variando de la velocidad del Scout en comparación con el Heavy o el Sniper al apuntar con el rifle. Algunos jugadores han hecho scripts con los que ajustan su sensibilidad con la clase deseada o incluso un arma específica.

Charge Dash Scripts

Since timing a charge and jump can be difficult, some players may use a quick script that binds the two actions to a button so that the charge dash will cover the maximum amount of distance possible. The player is still required to swing their melee weapon normally to end the charge though.

Quickscope Scripts

Many players find it difficult to scope in and fire straight after to get a quick headshot. There are scripts that will zoom in and fire just by clicking one button. This does require players to aim outside of the scope, though.

Rocket Jump Scripts

In order to Rocket Jump to a maximum height or distance, it is required that the player jumps, crouches, and fires their rocket at roughly the same time. This can be easily scripted to occur with the press of a button.

Auto-Disguise Scripts

For Spies who find manually disguising to be a hassle, this script automatically disguises as a chosen class after the player attacks with any weapon. Auto-disguise can usually be toggled and customized to choose a disguise to use.

ÜberCharge Broadcasting Scripts

With this script, activating ÜberCharge as Medic will also write a custom message in team chat to alert your teammates about your activation, in order to encourage your team to push ahead with you. A similar script, upon activation, plays the "ÜberCharge Ready" voice command while writing in team chat that you faked your Über to fool the enemy team.

Medic Radar

This script only works for Medic, as it lets you press a button to temporarily set the autocall percentage to a very high number. This makes it so that you can see the locations of nearby teammates. Script:

alias "autocall_default" "hud_medicautocallersthreshold 75.730003/Custom Threshold"
alias "autocall_all" "hud_medicautocallersthreshold 150"
alias "+radar" "autocall_all"
alias "-radar" "autocall_default"
bind [KEY] "+radar

Kill-Bind Scripts

Artículo principal: Suicide

In certain circumstances, such as when cornered by a Medic wielding the Übersaw, it can be beneficial for a class to be able to kill themselves quickly (in this case, to deny the Medic Über) with a key bind (for example, bind k kill). Although mostly only relevant in competitive play, there are occasional uses in public servers, often for comedic effect instead of to benefit gameplay. The killbind can be set to explode you if you use explode instead (for example, bind k explode). There is no difference between these two mechanically.

Null-Cancelling Movement Scripts

In stock TF2, pressing two opposing movement keys at once (such as "A" (+moveleft) and "D" (+moveright)) will cancel all movement and render the player immobile, which can be a fatal mistake during battle. This script makes it so that the direction of the last key pressed will be used instead. For example, pressing "A" will make the player go left, and pressing "D" while still holding "A" will make the player go right instead of stopping.

Chat Bind Scripts

Chat bind scripts are designed to post a pre-written message in the in-game text chat. Typically, users will bind these scripts to a key on their keyboard for easy repitition. These scripts can vary from user-to-user, and can say anything within the text limit, depending on what a player would want to say. Some common binds are used for team co-ordination, such as a bind to tell a team that their Medic has popped an ÜberCharge. Other common binds are used for banter, such as messages upon kills and/or dominations. Another variation on this is a trade offer bind, where it sends information to the chat about a possible trade offer. This type of script can also be automated to send these offers every couple of minutes.

Voice Toggle

This script enables you to voice toggle, instead of push-to-talk. Script:

bind [KEY] mic_toggle
alias mic_toggle mic_enable
alias mic_enable "+voicerecord; alias mic_toggle mic_disable"
alias mic_disable "-voicerecord; alias mic_toggle mic_enable"

Notas

  • Cada archivo de configuración se limita a un mebibyte (1,04858 MB) de información, dicha restricción se puede sortear ejecutando otro archivo de configuración al final del primero.

Veasé también

Enlaces externos