巨 集
![]() | 這頁 如果你會 |
巨 集 的 文 件
- config.cfg - 這是
默認 的 配置 文 件 ,當 你在選 項 裏面 做出更改 時 ,便 會 將 設定 儲 存在 此文件 。編輯 此文件 沒 有風 險 ,但 在 啟 動 遊戲 時 會 影響 到 修 改 過 的 按鍵配置 。每次 啟 動 遊戲 時 會 在 其他設置 讀取 之 前 優先 讀取 。- config_default.cfg - 這份
文 件 包含 了 一 組 基本 的 按鍵配置 ,如果 config.cfg不 存在 時 就會被 執行 作為 備份。
- config_default.cfg - 這份
- autoexec.cfg - 這是
儲 存 玩家設定 的 配置 文 件 ,你可以把巨 集 或 指令 儲 存在 此文件 。當 config.cfg和 autoexec.cfg都 有 相 同 的 指令 時 ,遊戲 會 以autoexec.cfg為 准
- <class>.cfg -
每 個 兵種 都 有 一 個 配置 文 件 ,你可以將綁定鍵 位 的 指令 儲 存在 這些文 件 。當 你選擇 了 相應 的 兵種 後 ,相應 文 件 的 指令 便 會 執行 。需要 注意 的 是 ,若 在 文 件 中 使用 了 開 關 類型 的 指令 時 作用 會 被 保留 ,直 到 執行 反 向 指令 為 止 。
編輯 巨 集 文 件
<Steam Folder>/SteamApps/common/team fortress 2/tf/cfg
~/Library/Application Support/Steam/SteamApps/common/team fortress 2/tf/cfg
~/.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 -
可 以讓客 戶 端 加 載 其他配置 文 件
- bind -
- <argument1>
可 以是鍵 位 的 名稱 或 創建 別名 的 名稱
- <argument1>
- <argument2>
可 以是被 綁定的 指令 或 別名 的 指令
- <argument2>
要 一 次 執行 多 條 指令 ,你必須將所以 指令 用 引號括 住 ,例 如:
- alias "spraynpray" "+attack; wait 500; -attack"
- bind "mouse3" "spraynpray"
- 按mouse3
後 ,開始 執行 別名 spraynpray,然 後 別名 spraynpray會 讓 你的武器 進行 攻擊 ,接 著 等 待 500幀,最後 停止 射擊 。
- 按mouse3
綁定(bind)
bind [KEY] [COMMAND]
bind [KEY] "[COMMAND 1]; [COMMAND 2]; [COMMAND 3]"
綁定
bind "e" "Voicemenu 0 0"
此綁
bind "w" "+forward"
此綁
切 換 (Toggle)
這項toggle "sv_cheats" 0 1
綁定切 換 (Bindtoggle)
bindtoggle o "sv_cheats" 0 1
遞增 值(Incrementvar)
bind MWHEELUP "incrementvar fov_desired 75 90 1"
bind MWHEELDOWN "incrementvar fov_desired 75 90 -1"
此範
註: Incrementvar
別名 (Alias)
Alias
註: Alias
alias Call_For_Medic "Voicemenu 0 0"
bind "e" "Call_For_Medic"
此巨
alias "+Diagonal" "+moveleft; +back"
alias "-Diagonal" "-moveleft; -back"
bind "z" "+Diagonal"
此巨
bind "z" "+moveleft; +back"
雖然按 Z
執行 (Exec)
此
exec autoexec.cfg
此巨
回 應 (Echo)
此
echo Scripting is; echo very useful.
如果Scripting isvery useful.
。
echo " Scripting is very useful. "
註:
等 待 (Wait)
此
註: 這項
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
實用 的 指令
Spy快速 偽裝
這些
disguise <class_number> <team_number>
<class_number>
偽裝 編 號 參 數
- 1 <class_number>
- 1:
偵察 兵 - 2:
狙擊 手 - 3:
火箭 兵 - 4:
爆破 兵 - 5:
醫 護 兵 - 6:
重 裝 兵 - 7:
火 焰兵 - 8:
間諜 - 9:
工程 師
- 1:
- 2 <team_number>
- 1:
藍 隊 - 2:
紅 隊 - -1:
敵 隊 - -2:
同隊
- 1:
Engineer快速 建造
build <building_number>
destroy <building number>
<building_number>
建築 編 號 參 數
- Number: Building/Destroying
- 0:
補給 器 - 1:
傳送 裝置 入口 - 2:
步哨 防禦 槍 /迷你戰 鬥步哨 - 3:
傳送 裝置 出口
- 0:
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>
語 音 相關 編 號
- 0 <phrase_number>
- 0:
醫 生 ! - 1:
謝 謝 ! - 2:
前進 !前進 !前進 ! - 3: 往前!
- 4: 往左
走 - 5: 往右
走 - 6:
好 - 7:
不
- 0:
- 1 <phrase_number>
- 0:
敵 人 來襲 - 1: Spy!
- 2:
前方 有 步哨 ! - 3: 這裡
需要 傳送 裝置 - 4: 這裡
需要 補給 器 - 5: 這裡
需要 步哨 - 6:
啟 動 ÜberCharge! - 7: (
只 有 Medic可 以使用 )ÜberCharge 就緒
- 0:
- 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
這些
alias "autocall_default" "hud_medicautocallersthreshold "75""
alias "autocall_all" "hud_medicautocallersthreshold "150""
alias "+radar" "autocall_all"
alias "-radar" "autocall_default"
bind mouse3 "+radar"
值得注意 的 巨 集
已 被 修正 的 巨 集
手槍 連射 巨 集
Targe Turn Scripts
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
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.
靈 敏 度 和 控 制 巨 集
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.