Difference between revisions of "Developer Console"

From Valve Developer Community
Jump to: navigation, search
(Undo revision 173270 by Zhongyi1225 (talk))
(Undo revision 173269 by Zhongyi1225 (talk))
Line 5: Line 5:
 
'''控制台''' 是一个用来配置和修改游戏的[[Wikipedia:Command-line interface|命令行界面]]工具. 事实上任何东西都可以通过控制台来修改, 并且有许多都是 ''必须的''.
 
'''控制台''' 是一个用来配置和修改游戏的[[Wikipedia:Command-line interface|命令行界面]]工具. 事实上任何东西都可以通过控制台来修改, 并且有许多都是 ''必须的''.
  
== 启用控制台 ==
+
== Enabling the console ==
  
控制台在默认情况下是无法启动的.激活它,需要开启游戏并在 ''设置 > 键盘 > 高级选项''. 这将会出现两个选项, 其中一个就是 "启用控制台". 一旦激活, 就可以通过 {{key|Tab}}上面的那个键, 也就是人民群众喜闻乐见的 "标题." {{key|~}}
+
The console starts disabled by default. To enable it, load the game and visit ''Options > Keyboard > Advanced''. There will be a pop-up that will include two options, one of them labeled "Enable Developer Console". Once enabled, it can be opened and closed by pressing the button above {{key|Tab}}, known as the "tilde." {{key|~}}
  
{{note|如果你的键盘上没有这个按键. 在游戏开始时,使用 <code>-console</code>启动游戏,然后输入<code>bind 按键 toggleconsole</code> (以代替原本的按键开启控制台).}}
+
{{note|This should work ''regardless'' of your keyboard layout. If it doesn't, add <code>-console</code> to the game's launch options and type <code>bind your_key toggleconsole</code> (replace your_key with the key to open the console).}}
  
== 提交 ==
+
== Submitting ==
  
底部灰色的输入框是用来输入命令的. 它支持两种输入格式: 命令和变量. 命令是一种的代码, 但是特殊变量指令 ("cvars") 需要赋值才能被控制台接受. 当你设置一个特殊变量指令时你应该这样做 :
+
The grey box across the bottom of the console window is where commands are entered. They come in two forms: commands and variables. Commands are simply keywords, but variables ("cvars") require a value of some sort before they are accepted. When setting a cvar you might type something like this :
  
 
  mat_wireframe 1
 
  mat_wireframe 1
  
当你输入结束时,敲击{{key|Return}}或者{{key|Enter}}来提交. 之后你将会在控制台窗口的最前端看到控制台返回你的信息 <code>]</code>.
+
When you've finished typing, hit {{key|Return}} or {{key|Enter}} to submit. You'll see everything you type 'echoed' to the console with a preceding <code>]</code>.
  
一些小提示:
+
A few notes:
  
* 使用空格键来分隔多个值. 如果一个值包含了字符, 请用双引号来区分这些字符. (例如<code>say "Hello everyone on the server"</code>.)
+
* Multiple values are separated with spaces. If a value contains a space, surround it with quote marks. (e.g. <code>say "Hello everyone on the server"</code>.)
* 控制台有时会自动识别出你将要输入的命令(在输入框的下方弹出你将可能输入的指令). 通过{{key|Up}}/{{key|Down}}键来翻阅这些指令并通过 {{key|Tab}}来选择这些指令.
+
* The console will suggest commands and sometimes values in a pop-out box beneath the input field. Press {{key|Up}}/{{key|Down}} to navigate the list and {{key|Tab}} to accept the highlighted suggestion.
* 只有"archived" 这个指令会在游戏结束后进行. 使用[[autoexec]]如果你想要在游戏开始自动运行一些指令.
+
* Only "archived" cvars are stored after the game closes. Use [[autoexec]] if you want to set any others when a game loads.
* 一些命令是服务器指令, 一些是客户端命令.在多人游戏中,你只能使用客户端命令.
+
* Some commands are serverside, others clientside. In multiplayer you can only set clientside ones.
* 有许多命令都带有前缀.其中最常见的就是<code>cl</code> ("客户端命令")<code>sv</code> ("服务器命令").
+
* There are many command prefixes. The most common are <code>cl</code> ("clientside") and <code>sv</code> ("serverside").
  
== 实用指令 ==
+
== Useful commands ==
  
; <code>find <关键字></code>
+
; <code>find <term></code>
: 这个经常使用到的指令<code>find</code>是用来搜索带关键字的指令的.十分有用
+
: The ever-useful <code>find</code> command searches console command names and descriptions for the term you provide.
; <code>find_ent <关键字></code>
+
; <code>find_ent <term></code>
: 和find命令一样,只不过这个是用来搜索带有关键字的地图.
+
: Similar to the find command above, but searches for entities within the map by name.
; <code>help <指令名></code>
+
; <code>help <command name></code>
: 简单的对所输入的指令名的功能进行介绍.
+
: Displays any help text for a command, without affecting its value.
 
;<code>sv_cheats <[[bool]]></code>
 
;<code>sv_cheats <[[bool]]></code>
:有许多特殊变量指令将会影响游戏性, 在多人游戏中这些指令将被视为作弊行为. 提交<code>sv_cheats 1</code>指令用来接触这些指令的限制. {{note|使用这个指令的服务器即使受到[[Valve Anti-Cheat|VAC]]的保护也不会因作弊指令而被ban.}}
+
: Most cvars that affect gameplay, especially in multiplayer games, are flagged as "cheats". Submit <code>sv_cheats 1</code> to unlock them. {{note|You will never be [[Valve Anti-Cheat|VAC]] banned for using built-in cheat commands.}}
 
;<code>developer <0-2></code>
 
;<code>developer <0-2></code>
:开发者模式将会提供更多的控制台命令,允许作弊和让控制台自动启动, 并且使得指令变得更加的有用和不受限制. 如果是使用<code>2</code>模式,最后出书的几行将会显示在屏幕上.
+
:Developer mode enables more verbose console output, enables cheats and the console automatically, and makes various other useful changes. If set to <code>2</code>, the last few lines of console output will be printed at the top of the screen as well.
;<code>con_log <文件名></code>
+
;<code>con_log <file></code>
 
;<code>condump</code>
 
;<code>condump</code>
:如果你想把控制台显示的内容保存成一个文件以便于以后使用,那么请使用这个命令吧. <code>con_log</code>是用来读取由<code>condump</code>保存的命令文件{{tip|控制台只能显示不超过241条的文件.也可以使用<code>con_log</code>来保存然后再继续操作.}}  
+
: Use one of these commands if you want to record what goes on in the console for later use. <code>con_log</code> writes output constantly, while <code>condump</code> records only when invoked. {{tip|The console only displays 241 lines at a time. Use <code>con_log</code> if you run up against this.}}  
{{note|这个命令在不同的source版本表现的也不同,在半条命2中,这两个命令无法被识别!在CS:GO中<code>con_log</code>这个命令正确写法是<code>con_logfile<文件名></code>}}
 
(中文译者注)
 
  
 
<!-- not convinced that this is useful == Command prefixes ==
 
<!-- not convinced that this is useful == Command prefixes ==
Line 82: Line 80:
 
-->
 
-->
  
== 查看更多 ==
+
== See also ==
  
 
* [[Developer Console Control]] - for programmers
 
* [[Developer Console Control]] - for programmers

Revision as of 15:13, 19 January 2013

Español Français Polski Русский 日本語 简体中文
Console output for Episode Two

控制台 是一个用来配置和修改游戏的命令行界面工具. 事实上任何东西都可以通过控制台来修改, 并且有许多都是 必须的.

Enabling the console

The console starts disabled by default. To enable it, load the game and visit Options > Keyboard > Advanced. There will be a pop-up that will include two options, one of them labeled "Enable Developer Console". Once enabled, it can be opened and closed by pressing the button above Tab , known as the "tilde." ~

Note:This should work regardless of your keyboard layout. If it doesn't, add -console to the game's launch options and type bind your_key toggleconsole (replace your_key with the key to open the console).

Submitting

The grey box across the bottom of the console window is where commands are entered. They come in two forms: commands and variables. Commands are simply keywords, but variables ("cvars") require a value of some sort before they are accepted. When setting a cvar you might type something like this :

mat_wireframe 1

When you've finished typing, hit Return or Enter to submit. You'll see everything you type 'echoed' to the console with a preceding ].

A few notes:

  • Multiple values are separated with spaces. If a value contains a space, surround it with quote marks. (e.g. say "Hello everyone on the server".)
  • The console will suggest commands and sometimes values in a pop-out box beneath the input field. Press / to navigate the list and Tab to accept the highlighted suggestion.
  • Only "archived" cvars are stored after the game closes. Use autoexec if you want to set any others when a game loads.
  • Some commands are serverside, others clientside. In multiplayer you can only set clientside ones.
  • There are many command prefixes. The most common are cl ("clientside") and sv ("serverside").

Useful commands

find <term>
The ever-useful find command searches console command names and descriptions for the term you provide.
find_ent <term>
Similar to the find command above, but searches for entities within the map by name.
help <command name>
Displays any help text for a command, without affecting its value.
sv_cheats <bool>
Most cvars that affect gameplay, especially in multiplayer games, are flagged as "cheats". Submit sv_cheats 1 to unlock them.
Note:You will never be VAC banned for using built-in cheat commands.
developer <0-2>
Developer mode enables more verbose console output, enables cheats and the console automatically, and makes various other useful changes. If set to 2, the last few lines of console output will be printed at the top of the screen as well.
con_log <file>
condump
Use one of these commands if you want to record what goes on in the console for later use. con_log writes output constantly, while condump records only when invoked.
Tip:The console only displays 241 lines at a time. Use con_log if you run up against this.


See also