Difference between revisions of "Console/zh-hans"

From Team Fortress Wiki
Jump to: navigation, search
(The floor is yours, Vtopl !)
 
Line 7: Line 7:
 
[[File:Advanced Keyboard Options.PNG|thumb|200px|right|The advanced keyboard options dialog that hides the option to enable the console]]
 
[[File:Advanced Keyboard Options.PNG|thumb|200px|right|The advanced keyboard options dialog that hides the option to enable the console]]
  
Access to the console is by default disabled. To open the console, a key must be bound to the command of opening the console. On US keyboards this defaults to the tilde key {{key|~}} . Additionally the console must be enabled in the advanced keyboard options sub dialog.
+
默认情况下开发者控制台是被禁用的.想要开启控制台,必须绑定一个键位来开启它. 在美式键盘上,它默认为波浪号键{{key|~}} .此外,还必须在进阶设置中启用控制台.
 
 
The console will be automatically opened, even if not enabled, when the game is launched using the {{kbd|-console}} argument. The {{kbd|-developer}} argument will also be automatically open the console, in addition to setting the {{cvar|developer}} and {{cvar|sv_cheats}} variables.
 
 
 
The console is not accessible in the Xbox or PlayStation versions of the game.
 
  
 +
即使未被启用,控制台也将自动打开, 当使用 {{kbd|-console}}指令时.{{kbd|-developer}}指令也会自动使控制台打开,而{{cvar|developer}}和{{cvar|sv_cheats}}两个变量不会被启动.
 +
Xbox和PlayStation版的军团要塞2无法访问控制台.
 
== 使用控制台 ==
 
== 使用控制台 ==
The console is split into two parts, the large output panel and the command prompt.
+
控制台分为两部分,一个大的命令输出面板和一排命令提示符.
  
 
=== 输出面板 ===
 
=== 输出面板 ===
In addition to showing the output from entered commands, the output panel also logs various game events, such as player deaths and chat text.
+
除了显示玩家输入的各种指令的输出外,输出面板还记录各种游戏事件,比如玩家的死亡信息和聊天内容.
  
The last few lines of the console output can be overlaid on top of the gameplay in the upper left corner. This is controlled by the {{cvar|developer}} console variable.
+
控制台输出的最后几行可以覆盖在游戏左上角.这是由{{cvar|developer}}变量控制的.
  
 
=== 指令提示符 ===
 
=== 指令提示符 ===
The command prompt accepts written commands. Commands are executed by hitting the return {{key|Return}} or enter key {{Key|Enter}}.
+
命令提示符能接收输入的指令,按下{{key|Return}}或者{{Key|Enter}}能执行命令.
 
 
Like other text fields in the GUI, it supports the clipboard, allowing the user to cut, copy and paste text.
 
  
The command prompt supports code completion. As the user types the command, the game will offer suggestions for what the user is typing. Hitting the tab key {{key|Tab}} will accept the suggestion, letting the user continue to type the command.
+
与GUI中其他字段一样,控制台支持剪贴板,允许玩家们剪切,复制并粘贴文本.
  
 +
命令提示符支持辅助指令完成功能.当玩家正在输入指令时,游戏将根据玩家输入的内容提供建议.按下Tab键{{key|Tab}}接受建议,并继续输入指令.
 
== 指令类型 ==
 
== 指令类型 ==
There are two kinds of commands, pure commands and so called console variables. The difference is that a console variable retains a value, while pure commands execute once.
+
控制台有两种不同的指令类型,纯指令和所谓的控制台变量.区别在于,控制台变量能保留一个值,而纯指令只执行一次.
 
 
Commands are flagged as being one or more of special types of commands.
 
  
 +
命令通常被标为一种或多种特殊形式的指令.
 
=== 输入指令 ===
 
=== 输入指令 ===
Some commands are special and have a name beginning with a plus sign. These commands provide input used to play the game. When bound to a key they have the special property of automatically issuing their twin off command (indicated by beginning with a minus sign instead of the plus sign) when the key is released.
+
有些指令很特殊,其开头为一个加号.这些指令提供游戏内的命令.当绑定到某个键时,它们便具有特殊的属性,使得它们在释放键时能自动发出孪生的关闭命令(以减号开头而不是加号开头).
 
 
 
=== 作弊 ===
 
=== 作弊 ===
 
{{Main|Cheats/zh-hans|作弊}}
 
{{Main|Cheats/zh-hans|作弊}}
Many commands are considered too powerful for normal players and are marked as cheats. Unless explicitly allowed by the server owner using the {{cvar|sv_cheats}} variable, pure commands marked as cheats will not execute and console variables will be reverted to their default values.
+
许多指令被玩家们认为过于强大而被标记为作弊指令. 除非服主使用并明确了{{cvar|sv_cheats}}变量的值,否则那些被标记为作弊指令的将不会被执行,并且变量会变回初始值.
 
+
=== 离线指令 ===
=== Offline commands ===
+
大多数指令只在已连接到服务器时才有意义,除非连接到服务器,否则游戏会拒绝它们的执行.但有些指令在即使没有连接到服务器的情况下也有意义,它们便被标记为离线指令.
Most commands only make sense when connected to a server. As such the game will prevent them being used unless connected to a server. A few do make sense even without a connected server and are marked as such.
 
  
 
=== <!-- 复制变量? -->Replicated variables ===
 
=== <!-- 复制变量? -->Replicated variables ===

Revision as of 18:29, 2 October 2019

军团要塞2 中的开发者控制台、

控制台是用户界面的一部分,它用于为游戏开发者、内容创建者和进阶玩家提供服务。这是一个以文本为基础的信息面板,允许使用者通过输入游戏识别的文本指令来进行特殊操作。

开启控制台

The advanced keyboard options dialog that hides the option to enable the console

默认情况下开发者控制台是被禁用的.想要开启控制台,必须绑定一个键位来开启它. 在美式键盘上,它默认为波浪号键~ .此外,还必须在进阶设置中启用控制台.

即使未被启用,控制台也将自动打开, 当使用 -console指令时.-developer指令也会自动使控制台打开,而developersv_cheats两个变量不会被启动. Xbox和PlayStation版的军团要塞2无法访问控制台.

使用控制台

控制台分为两部分,一个大的命令输出面板和一排命令提示符.

输出面板

除了显示玩家输入的各种指令的输出外,输出面板还记录各种游戏事件,比如玩家的死亡信息和聊天内容.

控制台输出的最后几行可以覆盖在游戏左上角.这是由developer变量控制的.

指令提示符

命令提示符能接收输入的指令,按下Return或者↵ Enter能执行命令.

与GUI中其他字段一样,控制台支持剪贴板,允许玩家们剪切,复制并粘贴文本.

命令提示符支持辅助指令完成功能.当玩家正在输入指令时,游戏将根据玩家输入的内容提供建议.按下Tab键Tab ⇆接受建议,并继续输入指令.

指令类型

控制台有两种不同的指令类型,纯指令和所谓的控制台变量.区别在于,控制台变量能保留一个值,而纯指令只执行一次.

命令通常被标为一种或多种特殊形式的指令.

输入指令

有些指令很特殊,其开头为一个加号.这些指令提供游戏内的命令.当绑定到某个键时,它们便具有特殊的属性,使得它们在释放键时能自动发出孪生的关闭命令(以减号开头而不是加号开头).

作弊

主条目: Cheats/zh-hans, 作弊

许多指令被玩家们认为过于强大而被标记为作弊指令. 除非服主使用并明确了sv_cheats变量的值,否则那些被标记为作弊指令的将不会被执行,并且变量会变回初始值.

离线指令

大多数指令只在已连接到服务器时才有意义,除非连接到服务器,否则游戏会拒绝它们的执行.但有些指令在即使没有连接到服务器的情况下也有意义,它们便被标记为离线指令.

Replicated variables

Some variables must have the same value on both the server and the client. The game will temporarily override those variables on the client when connected to a server.

Archived variables

Some variables contain user settings that should persist across play sessions. They are stored in the config.cfg file by the game.

Protected variables

Certain variables contain data that should not be sent between clients and the server, such as passwords.

Demo required/forbidden

Some variables influence the recording of gameplay demos and as such need to be included/excluded from the demo recording.

Change notification

Some variables are deemed to be important enough to alert all players on the server when they are changed. Changes to these variables are shown among the chat text overlay.

Change notify variables are included by default in server rule queries done by external tools.

Special script files

Team Fortress 2 automatically reads several game files and executes any commands within them. Here is the list of those files:

  • config.cfg - This is the default configuration file which is edited to reflect any in-game changes to keybinds or video settings. It is safe to edit this file, but it will change to reflect any modified keybinds on startup. This config will run every time the game starts up, before any other config.
    • config_default.cfg - This contains a basic set of keybinds, and will be executed as a backup if config.cfg is not present.
  • autoexec.cfg - This is the default config file for executing custom keybinds and aliases. This config will run every time the game starts up, after config.cfg.
  • Each class has a config file which automatically runs whenever a player switches to that class. Note that any settings set in one classes config file will be retained when switching classes unless explicitly rebound. They are as follows:
    • scout.cfg, soldier.cfg, pyro.cfg, demoman.cfg, heavyweapons.cfg, engineer.cfg, medic.cfg, sniper.cfg, spy.cfg
  • A config file can be created for any map if it shares the same name, and will run whenever that map is loaded. For example, a cp_well.cfg file will be automatically run any time Well (Control Point) is loaded.

Script paths

If on Windows, scripting files may be found in:
<Steam Folder>/SteamApps/common/team fortress 2/tf/cfg
If on a Mac, scripting files may be found in:
~/Library/Application Support/Steam/SteamApps/common/team fortress 2/tf/cfg
If on Linux, scripting files may be found in:
~/.steam/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

远程控制台

Dedicated servers are exclusively controlled from the console. However, logging in to the server and reattaching to the console is a major hassle. Instead server administrators can use the remote console system. The game server runs an additional service that accepts console commands from remote clients. This is secured using a dedicated password.

Map issued commands

Maps can issue console commands using the point_servercommand, point_clientcommand and point_broadcastclientcommand entities.

参见