きょしゅう

From Team Fortress Wiki
Jump to: navigation, search

きょしゅうまたたたえため腳本,使用しよう配置はいちぶんけんらいひかえせいだいてき指令しれい碼綁じょういたかぎあるすう指令しれい綁定なりいちしんてき別名べつめい

きょしゅうしょ涵蓋てき範圍はんい以從綁定かぎいた使用しよう別名べつめいらい自動じどう重複じゅうふく指令しれい。甚至使用しようきょしゅうらい創建そうけん千變萬化せんぺんばんかてき行為こうい

內容

きょしゅうてきぶんけん

ぜっ要塞ようさい2かい自動じどう讀取よみと以下いかいく遊戲ゆうぎぶんけんらい實行じっこうきょしゅう

  • config.cfg - 這是默認もくにんてき配置はいちぶんけんとう你在せんこう裏面りめん做出更改こうかい便びんかいはた設定せっていもうか存在そんざい此文けん編輯へんしゅう此文けんぼつ有風ゆうふうけんただしざいけいどう遊戲ゆうぎかい影響えいきょういたおさむあらためてき按鍵配置はいち每次まいじけいどう遊戲ゆうぎかいざい其他設置せっち讀取よみとこれぜん優先ゆうせん讀取よみと
    • config_default.cfg - 這份ぶんけん包含ほうがんりょういちくみ基本きほんてき按鍵配置はいち,如果 config.cfg 存在そんざい就會執行しっこう作為さくい備份。
  • autoexec.cfg - 這是もうかそん玩家設定せっていてき配置はいちぶんけん,你可以把きょしゅうある指令しれいもうか存在そんざい此文けんとうconfig.cfgautoexec.cfgゆうしょうどうてき指令しれい遊戲ゆうぎかい以autoexec.cfgためじゅん
  • <class>.cfg - まい兵種へいしゅゆういち配置はいちぶんけん,你可以將綁定かぎてき指令しれいもうか存在そんざい這些ぶんけんとう選擇せんたくりょう相應そうおうてき兵種へいしゅ相應そうおうぶんけんてき指令しれい便びんかい執行しっこう需要じゅよう注意ちゅういてきわかざいぶんけんちゅう使用しようりょうひらきせき類型るいけいてき指令しれい作用さようかい保留ほりゅうちょくいた執行しっこうはんこう指令しれいためどめ

編輯へんしゅうきょしゅうぶんけん

わかざい Windows 系統けいとうきょしゅうぶんけんのうざいしたれつ資料しりょう夾找到:
<Steam Folder>/SteamApps/common/team fortress 2/tf/cfg
わかざい Mac 系統けいとうきょしゅうぶんけんのうざいしたれつ資料しりょう夾找到:
~/Library/Application Support/Steam/SteamApps/common/team fortress 2/tf/cfg
わかざい Linux 系統けいとうきょしゅうぶんけんのうざいしたれつ資料しりょう夾找到:
~/.local/share/Steam/SteamApps/common/Team\ Fortress\ 2/tf/cfg
Since the SteamPipe update, code can also be placed in .../team fortress 2/tf/custom/yourfoldernamehere/cfg

語法ごほう

The following is a list of commands which have no use apart from scripting; they do not influence gameplay directly. 這是いち語法ごほうてき規則きそく

  • 無論むろん綁定ある別名べつめい,你都よう按照以下いか格式かくしきらいへんうつし
命令めいれい <argument1> <argument2>
  • 目前もくぜんゆうさんしゅ命令めいれいきょう選擇せんたく
  • bind - よう於將指令しれい綁定いたかぎ
  • alias - 以將指令しれい綁定なり別名べつめいらいいちせい執行しっこう
  • exec - 以讓きゃくはし其他配置はいちぶんけん
  • <argument1> 以是かぎてき名稱めいしょうある創建そうけん別名べつめいてき名稱めいしょう
  • <argument2> 以是綁定てき指令しれいある別名べつめいてき指令しれい
  • よういち執行しっこうじょう指令しれい,你必須將所以ゆえん指令しれいよう引號くくじゅうれい如:
alias "spraynpray" "+attack; wait 500; -attack"
bind "mouse3" "spraynpray"
  • 按mouse3開始かいし執行しっこう別名べつめいspraynpray,しかこう別名べつめいspraynprayかいゆずる你的武器ぶき進行しんこう攻擊こうげきせっちょとうまち500幀,最後さいご停止ていし射擊しゃげき

綁定(bind)

さい簡單かんたんてき語法ごほう bind 指令しれいのう影響えいきょう按鍵執行しっこうてき動作どうさ,該動作どうさ以是設定せってい指令しれいある腳本。

bind [KEY] [COMMAND]
以加じょうそう引號ざい按鍵名稱めいしょうある指令しれいてき左右さゆう

bind [KEY] "[COMMAND 1]; [COMMAND 2]; [COMMAND 3]"
以加じょうそう引號ざい按鍵めいただし一定要用雙引號包住多項指令。


綁定ゆうりょうたね形式けいしき
bind "e" "Voicemenu 0 0"
此綁ていとう玩家按下Eかぎ後會こうかい觸發しょくはつ『Medic!』てきおん指令しれい

bind "w" "+forward"
此綁ていとう玩家按住 W かぎのう夠讓玩家前進ぜんしん

せつかわ(Toggle)

這項きょしゅう設置せっち兩個りゃんこある兩個りゃんこ以上いじょう值的指令しれい進行しんこうせつかわtoggle "sv_cheats" 0 1

綁定せつかわ(Bindtoggle)

こうのう toggle しょうどうただ綁定いたいち按鍵じょうbindtoggle o "sv_cheats" 0 1

注意ちゅういわか設定せっていすう值,toggle bindtoggle そくかい默認もくにんすう值為 0 あずか 1。

遞增ていぞう值(Incrementvar)

設置せっち一個數值以反覆執行增加或減少值。

bind MWHEELUP "incrementvar fov_desired 75 90 1"
bind MWHEELDOWN "incrementvar fov_desired 75 90 -1"

此範れいのうゆずる玩家向上こうじょうたぎどうすべりねずみたぎ增加ぞうか視野しやこうしたたぎどうそく減少げんしょう
註: Incrementvar 指令しれい如果ゆずるすう值超あるへんとく過小かしょうかい重複じゅうふく循環じゅんかんざい此範れいちゅう,如果視野しや超過ちょうか 90 のりかい下降かこういた 75 ,たんまたしか

別名べつめい(Alias)

Alias 以將多項たこう指令しれいいち名稱めいしょう代替だいたいなりため一個有效用的簡寫名稱。とう一系列的指令需要被重複執行時會非常有用。
註: Alias 名稱めいしょう不能ふのう包含ほうがんそらかく包含ほうがんそこせん數字すうじある符號ふごう。 Alias かい區分くぶん大小だいしょううつし

alias Call_For_Medic "Voicemenu 0 0"
bind "e" "Call_For_Medic"

此巨しゅういち簡單かんたんてき綁定,こうのうとう玩家按下 E 後會こうかい觸發しょくはつ『Medic!』おん指令しれい

alias "+Diagonal" "+moveleft; +back"
alias "-Diagonal" "-moveleft; -back"
bind "z" "+Diagonal"

此巨しゅう以讓玩家はすこう移動いどう,按下 Z 玩家かい往左後方こうほうはすちょはし

警告けいこくしもれつうつしほうかいゆう作用さよう
bind "z" "+moveleft; +back"
雖然按 Z 以讓玩家往左及後かた移動いどうただし遊戲ゆうぎ引擎かい反轉はんてん +back 指令しれいしるべ致放ひらく Z こう玩家かい停止ていし向後こうご移動いどう

執行しっこう(Exec)

指令しれい執行しっこう其他てきぶんけん檔。意味いみちょ複雜ふくざつてききょしゅう存在そんざい其他ぶんけん檔裡,以免ろうらん一般いっぱんてきぶんけん

exec autoexec.cfg
此巨しゅうはた會讀かいどく autoexec.cfg ぶんけん內的きょしゅう

かいおう(Echo)

指令しれいかいはた文字もじ顯示けんじいたひかえせいだいじょうたい於偵錯非常ひじょう有用ゆうよう

echo Scripting is; echo very useful.
如果しょうぶんごう(;)ざい文字もじあいだそくかい顯示けんじ Scripting isvery useful.あるはた文字もじようそう引號つつみじゅう,如下れい

echo " Scripting is very useful. "
のりかいはたあまりてきそらかく顯示けんじ出來できいんため包含ほうがんざいそう引號內。

註: そう引號無法むほう顯示けんじてき符號ふごういんため它的用途ようとかい曲解きょっかい

とうまち(Wait)

指令しれい使遊戲ゆうぎとうまちしょ設定せっていてき FPS すう值後ざい執行しっこういち指令しれい
註: 這項指令しれい對應たいおうてき實際じっさい間取まどりけつ於伺ふくてき處理しょりそくりつ
警告けいこく: Wait 指令しれいざい部分ぶぶん伺服きんよう。這會しるべ致某些巨しゅう失效しっこうなみ且(ざい極少きょくしょうすうてき情況じょうきょうゆずる遊戲ゆうぎ當機とうき。請看 Wait Testing 避免這種情況じょうきょう發生はっせい

echo Why did the chicken cross the road?; wait 66; echo To get to the other side!
This script will wait 66 frames (1 second on most servers) before printing the punchline.

ぜっ要塞ようさい2てき鍵盤けんばん名稱めいしょう

すべりねずみうつりじょう按鍵そくいた按鍵名稱めいしょう

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

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

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

⇪ Caps A S D F G H J K L ; '   ↵  

⇧ Shift Z X C V B N M , . / ⇧ Shift

Ctrl Alt       Spacebar       ≣ Menu Ctrl

PrtScn ScrLk Pause

Insert Home PgUp

Delete End PgDn


       

   

Num / * -
7 8 9 +
4 5 6
1 2 3
    0     .
すべりねずみ按鍵 按鍵名稱めいしょう
たぎじょうすべり MWHEELUP
たぎすべり MWHEELDOWN
ひだりかぎ MOUSE1
みぎかぎ MOUSE2
てんげきたぎ MOUSE3
左側ひだりがわかぎしたいちぺーじ MOUSE4
右側みぎがわかぎうえいちぺーじ MOUSE5

實用じつようてき指令しれい

しゅ條目じょうもくTF2 指令しれい及值數列すうれつひょうえい

Spy快速かいそく偽裝ぎそう

這些きょしゅう以讓玩家按下一個鍵後即偽裝而不用開啟偽裝菜單

偽裝ぎそう命令めいれい使用しよう以下いか語法ごほう

disguise <class_number> <team_number>

<class_number>代表だいひょう兵種へいしゅてきへんごう;<team_number>代表だいひょうだんたいてきへんごう

偽裝ぎそうへんごうさんすう

  • 1 <class_number>
    1: 偵察ていさつへい
    2: 狙擊そげきしゅ
    3: 火箭かせんへい
    4: 爆破ばくはへい
    5: まもるへい
    6: じゅうそうへい
    7: 焰兵
    8: 間諜かんちょう
    9: 工程こうてい
  • 2 <team_number>
    1: あいたい
    2: べにたい
    -1: てきたい
    -2: 同隊どうたい

Engineer快速かいそく建造けんぞう

類似るいじSpyてき快速かいそく偽裝ぎそう,這可以讓Engineer必開けい建造けんぞうさいたんそくのう建造けんぞう

建築けんちく指令しれい使用しよう以下いか語法ごほう

build <building_number>
destroy <building number>

<building_number>建築けんちくてきへんごう

建築けんちくへんごうさんすう

  • Number: Building/Destroying
    0: 補給ほきゅう
    1: 傳送でんそう裝置そうち入口いりくち
    2: 步哨ほしょう防禦ぼうぎょやり/迷你せん步哨ほしょう
    3: 傳送でんそう裝置そうち出口でぐち

以下いか快速かいそく建造けんぞうきょしゅうてきれい

 alias sentry "destroy 2; build 2"
alias Dispenser "destroy 0; build 0"
alias entrance "destroy 1; build 1"
alias exit "destroy 3; build 3"
bind f1 sentry
bind f2 dispenser
bind f3 entrance
bind f4 exit

這巨集會しゅうかいざい建造けんぞうぜんさき破壞はかいよう建造けんぞうてき建築けんちく使つかい玩家建造けんぞうぜん需開けい破壞はかいさいたん

かたりおん指令しれい

かたりおん指令しれい以讓你在遊戲ゆうぎ發出はっしゅつ特定とくていてきおん

かたりおん指令しれい使用しよう以下いか語法ごほう

voicemenu <menu_number> <phrase_number>

<menu_number>へんごう1いた3てきおんさいたんへんごう,<phrase_number>すなわちおんさいたん1いた7てきおとへんごう

かたりおん相關そうかんへんごう

  • 0 <phrase_number>
    0: せい
    1: しゃしゃ
    2: 前進ぜんしん前進ぜんしん前進ぜんしん
    3: 往前!
    4: 往左はし
    5: 往右はし
    6: このみ
    7:
  • 1 <phrase_number>
    0: てきじん來襲らいしゅう
    1: Spy!
    2: 前方ぜんぽうゆう步哨ほしょう
    3: 這裡需要じゅよう傳送でんそう裝置そうち
    4: 這裡需要じゅよう補給ほきゅう
    5: 這裡需要じゅよう步哨ほしょう
    6: けいどう ÜberCharge!
    7: (ただゆうMedic使用しよう)ÜberCharge 就緒
  • 2 <phrase_number>
    0: 幫我!
    1: せん咆哮ほうこう
    2: 乾杯かんぱい
    3: 嘲弄ちょうろう
    4: おさむいた
    5: くだり
    6: とくこのみ
    7: みきとくこのみ


ざつこう

  • clear きよしじょひかえせいだいてき所有しょゆう訊息。
  • alias れつ所有しょゆう目前もくぜん定義ていぎてき別名べつめい
  • fov_desired (75-90) 設置せっち視野しや距離きょり
  • viewmodel_fov 設置せっち武器ぶき模型もけいてき視野しや默認もくにん範圍はんいため 54~70 これあいだ
  • r_drawviewmodel (0/1) 顯示けんじ(1) あるかくれぞう(0) 武器ぶき模型もけい
  • lastdisguise 使つかい玩家偽裝ぎそう成上なりかみいち偽裝ぎそうてき職業しょくぎょう間諜かんちょう專用せんよう
  • load_itempreset [0, 1, 2, 3] さらかわていてき [A, B, C, D] 裝備そうびらん
  • say "message" 發送はっそう公開こうかいてき聊天訊息。
  • say_team "message" 發送はっそう隊伍たいご聊天訊息。
  • +taunt 玩家かい進行しんこうあざけ動作どうさ
  • +use_action_slot_item 玩家かい使用しよう動作どうさらんしょ裝備そうびてき物品ぶっぴん
  • volume (0-1) 改變かいへん遊戲ゆうぎちゅうてき音量おんりょう

高級こうきゅうきょしゅう技巧ぎこう

Toggles

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

bind w toggle
alias toggle "enable"
alias enable "alias toggle disable; +forward"
alias disable "alias toggle enable; -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 Ubercharge.
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.

Wait-testing

よしwait 指令しれい一些巨集不可缺少的部分,利用りよう此指れい查看伺服のう使用しようとうまち指令しれい

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; +right; wait 33; redirect"
alias redirect loop

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 (1second on most servers). Pressing G would cause the next iteration of the loop to stop, also stopping the firing.


Medic Radar

這些きょしゅう以讓Medicただよう按住いち按鍵,就將自動じどうよびすくいてき上限じょうげんひさげますいたり150%(まもるへいのうちょうりょう治療ちりょうてき生命せいめい上限じょうげん),ゆずる以看いた附近ふきん所有しょゆうたいともてき位置いち

 alias "autocall_default" "hud_medicautocallersthreshold "75""
alias "autocall_all" "hud_medicautocallersthreshold "150""
alias "+radar" "autocall_all"
alias "-radar" "autocall_default"
bind mouse3 "+radar"

あずかしつらえてき自動じどうよびすくい值(也就ぼつゆう使用しよう這個きょしゅうてき自動じどうよびすくい值)調整ちょうせいためにんなん你想ようてき值(ざい這個れい子中こなか75%),けいどうきょしゅうてき按鈕也可以改ため任意にんい按鍵(ざい這個れい子中こなかmouse3)。

值得注意ちゅういてききょしゅう

ゆう些巨集會しゅうかい破壞はかい遊戲ゆうぎてき環境かんきょう平衡へいこう

やめ修正しゅうせいてききょしゅう

手槍てやり連射れんしゃきょしゅう

はらさき遊戲ゆうぎうらてき手槍てやりただのう單發たんぱつ射擊しゃげき後來こうらい有人ゆうじんへんうつしりょう手槍てやり連射れんしゃきょしゅうゆずる玩家一直按下鍵位即可連續發射手槍。後來こうらいValveためりょう確保かくほ遊戲ゆうぎ公平こうへいせいゆずる玩家そく使使用しようきょしゅう也可以連續れんぞく發射はっしゃ手槍てやり

Targe Turn Scripts

よう鍵盤けんばん改變かいへん視角しかくあずかようすべりねずみ改變かいへん視角しかく不同ふどうてき兩個りゃんこ動作どうさ衝擊しょうげきとげたてだい一個限制改變視角速度的武器,而Valve雖然たい使用しよう該武すべりねずみ改變かいへん視角しかくてき速度そくど做出げんせい,卻忘りょうたい鍵盤けんばん指令しれい做出しょうどうきりせいゆう玩家利用りよう這個特性とくせいうつしりょうじゅうしん改變かいへん輸出ゆしゅつてききょしゅうゆずる們可以用正常せいじょうてき速度そくど改變かいへん視角しかくさい複雜ふくざつてきれい子中こなか,玩家ざい衝刺すべりねずみてきxじく指令しれい改變かいへん為相ためすけどう結果けっかてき鍵盤けんばん指令しれいざい衝刺結束けっそくさいしょう這個改變かいへんかえはら

Valveこれたい鍵盤けんばん指令しれい做出しょうどうきりせいいん此這きょしゅうさい也沒ゆう作用さようりょうしか而,かえ以寫いちきょしゅうゆずる玩家ざい衝刺ゆうちょうこうすべりねずみれいさとたびざい攻擊こうげき恢復かいふく正常せいじょう。It is also possible to turn easily while using a gamepad's analog sticks.

つくばいとべきょしゅう

はらさきとべいた空中くうちゅうつくばいてき次數じすうぼつ有限ゆうげんせいてきよし此你以在空中くうちゅう執行しっこう一個不斷超高速蹲下站起的巨集,ゆずる遊戲ゆうぎぼつ辦法正常せいじょう判斷はんだんだんげきちゅう你。Valve修正しゅうせいためざい空中くうちゅうただのうつくばい兩次りょうじ

Gloves of Running Urgently Scripts

The Gloves of Running Urgently used to drain 6 health per second while active. However, jumping preserved the speed bonus granted by this weapon and did not require the weapon to be active. Simple scripting allowed for the player to quickly switch to the gloves, jump, and then switch away.

2012ねん6がつ27にち更新こうしん: Replaced the damage over time of the Gloves of Running Urgently with a time-delayed mini-crit de-buff.

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.

目前もくぜんてききょしゅう

Weapon Viewmodel Hiding Scripts

There are a large number of scripts which toggle the weapon viewmodel depending on which weapon slot is selected for a class. Players often make their viewmodels invisible to clear up the screen, but make items like melee weapons, PDAs, watches, and so forth visible because these models indicate important information. For example, the Spy relies heavily on his viewmodel to determine when he is cloaked, when his Cloak is disturbed, and when the Dead Ringer activates. Other classes use the melee animations to judge when their attacks will hit.

Sentry Jumping Scripts

Since the Engineer Update, Engineers have been able to pack up and carry their Sentry Guns. Simultaneously introduced in the update, the Wrangler allows 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.

While a human can repeat this feat, it is difficult. Some players made scripts which could reliably execute the commands in the right order at the right speed allowing them to make a Sentry jump while carrying their Sentry every time.

Note: The Rescue Ranger can circumvent this necessity, as it can pick up buildings at range for 130 metal.

Gunslinger Scripts

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 Combat Mini-Sentry with the click of one or two mouse buttons. Such a script is especially useful when using the Frontier Justice, as the player gains practically instant access to revenge crits when needed.

れいさとたびひかえせいきょしゅう

たい於一些對於喜歡不同的靈敏度和控制的巨集(れい如,改變かいへん偵察ていさつへい,這就需要じゅようだかれいさとたび快速かいそくてんどう操作そうさたい於狙げきしゅつづみ使用しようていれいさとたび精確せいかく瞄準這樣一隻手無意抽搐的時候不會偏離你的目標太大). These scripts alter their control schemes and mouse settings on a per class or even per weapon basis.

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 mouse 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.

Kill-bind Scripts

In certain circumstances is it beneficial for a class to be able to kill themselves. Although mostly only relevant in competitive play, there are occasional uses in public servers.

まいり

外部がいぶ鏈接