控制台
/File/en/Translation.png
该文档正从 英语 翻译为 汉语
源文档标题: en/Manual/Console
完成度: 1%
  
  • 请帮助改进本文。
  • 参考风格指南编写正确的版本。
  • 在完成翻译后移除该模板。
OpenTTD 游戏手册
安装 · 教程
常见问题(en) · 游戏界面(en)
README.md
基础建设

铁路 :

信号灯 · 车站 · 交叉 · 设计技巧
公路建设 · 有轨电车 · 水路建设 · 机场 · 更改地形
载具
列车 · 汽车 · 船只 · 飞机 · 调度指令
选项
游戏选项 · 高级选项(en) · AI选项(en) · NewGRF · 作弊指令
图形与声音(en)
OpenGFX · OpenMSX · OpenSFX
更多主题
气候 · 城镇 · 工业 · 经济 · 灾难 · 游戏技巧 · 快捷键 · 控制台 · 游戏机制 · 多人游戏 · 场景编辑器 · 在线内容
故障排除 · 链接(en)

The console allows you to see Multiplayer (en) chat history and to execute command-line commands in Manual (en). Most of the commands are used to configure multiplayer servers.

Contents

The OpenTTD Console

使用控制台

Open the console with the tilde key (~), located to the left of '1' on the main keyboard. On some layout international keyboards the symbol may differ (e.g. on the layout#Germany and Austria (but not Switzerland) German keyboard it is ^ TWICE). There is also a "Toggle Console" option in the help menu.
After the console is open, type in a command, such as "help" and press Enter.

提示:

控制台指令

Here is a list of all the console commands available in OpenTTD. Brackets [] mean "optional". A vertical line | means "or". Underscores _ in the command name are optional. The list is organized with the most useful commands at the top. This list is also available alphabetically. Remember that quote marks are supposed to be written in the console too!

帮助指令

指令 描述
help [<item>] 显示基本控制台帮助,指定<item>以获取该特定命令或变量的帮助。
list_cmds [<filter>] 列出所有可用的命令,可选地仅列出以<filter>开头的命令。
list_settings [<filter>] 列出所有已注册的变量,也可以只列出以<filter>开头的变量。
list_aliases List all available aliases.
list_patches List all Advanced Settings (en).

游戏指令

These commands work both in single player games and on servers.

指令 描述
newgame 开始新游戏
restart Restart the same game.
connect <host> Connect to a network game running on <host>. Not available for the server.
reconnect Reconnects to the last server you were playing on. (Introduced in r17466, only in version 1.0 or later)
save <number | file> Saves the current game as <number> or <file>.
load <number | file> 加载游戏存档 <编号> 或 <文件名>.
part Quit a running game and go back to the intro menu. Not available for the server.
exit / quit 退出游戏。

多人游戏指令

These commands are used to run a multiplayer game Server (en). Some commands also work for connected clients.

指令 描述 Clients
kick <ip | client-id> Kick the client with IP <ip> or id <client-id>. No
ban <ip | client-id> Ban the client with IP <ip> or id <client-id>. No
unban <ip> Remove a ban on <ip>. No
banlist 被禁用客户端列表 No
reset_company <company-id> Delete the company identified by <company-id>. No
pause 暂停多人游戏 No
unpause 取消暂停多人游戏 No
clients Lists client id, name, company id, and IP address of each client. Yes
companies Show a list of players and their attributes, e.g. company name, loan value, number of vehicles etc. No
status Get the status information on all currently connected clients. No
server_info List current and maximum client/player limits. No
say "<msg>" Send a chat message containing <text> to all players. Yes
say_client <client-id> "<msg>" Send a chat message containing <msg> to the client identified by <client-id>. Yes
say_player <player-id> "<msg>" Send a chat message containing <msg> to everyone in the company identified by <player-id> (1-10). Yes
rcon <password> "<command>" Execute <command> on the server authenticated by <password> while connected as a client. The password must be set in advance locally on the server with by "rcon_pw <password>". Yes
join <company-id> [<password>] Join a company, <password> is only needed if the company you want to join is password protected Yes
spectate alias to join 255 Yes
move <client-id> <company-id> move a client to any company, use company-id of 255 to move the client to spectators No
client_name <client-id> <name> Rename a client's username, this is useful if a client e.g. joins with an offensive username No
list_ai List of available ai's on server Yes
start_ai <ai>[.<version>] Start an available ai, with the specified version if supplied No
stop_ai <company-id> Stop an existing AI, the company will get completely purged from the map afterwards No

File handling commands

Command Description
cd <directory | number> Change the working directory to <directory> or <number>.
ls / dir List files of current directory.
pwd Print out the current working directory.
rm <number | file> Remove a savegame by name or index.
Command Description
script <file> Record a script to the file named <file>.
exec <script> <?> Executes a local script file.
return Stop executing a running script.
Command Description
content update Updates the list of available online content.
content upgrade Select all files which are upgrades (of locally existing files)
content select (ID / all) Select item by ID or select all
content unselect (ID / all) Unselect item by ID or unselect all
content state Show the state (selected / unselected) of all items
content download Download all selected online content

其他指令

Command Description
screenshot [big | giant | no_con] Takes a screenshot. 'big' makes a zoomed in screenshot of a selected area. 'giant' make a screenshot of the whole map. 'no_con' hides the console to create a normal screenshot.
alias <name> <command> Create an alias named <name> bound to <command>.
set <setting_name> [<newvalue>] Get and set the setting from the console. If <newvalue> is omitted the current value is printed. See Console Settings for a listing of all available settings.
dump_vars Print all known variables and their values.
getseed Returns the seed used to create the game, for randomly generated games. The seed can be used to reproduce the same starting map.
scrollto <tile> Scroll to the tile numbered <tile>; accepts hexadecimal (prexifed with 0x) and decimal values. Use the land area information tool to get the number of a specific tile.
clear 清屏控制台。
echo <text> Print out <text> on the console.
echoc <color> <text> Print out <text> in color <color>. <color> is a number between 0 and 255.
info_cmd <command> Show technical information on the command <command>.
info_var <variable> Show technical information on the variable <variable>.
debug_level [<level>] Get / set the debugging levels of different parts of the game.
resetengines Resets all use-age and availability of engines.

Variables

Here is a list of variables available in OpenTTD. See the value of a variable by typing setting variablename. Change the value by typing setting variablename followed by the new value. Set boolean variables with 'on' or 'off'. Reset a text variable to empty by using * as new value.

Server variables

Variable Description Default value
autoclean_companies Automatically shut down inactive companies to free them up for other players. Customize with 'autoclean_(un)protected' and 'autoclean_novehicles' off
autoclean_protected Automatically remove the password from an inactive company after the given amount of months. 36
autoclean_unprotected Automatically shut down inactive companies after the given amount of months. 12
autoclean_novehicles Automatically shut down companies without vehicles after the given amount of months. 0
max_clients Maximum number of players allowed on the server 10
max_companies Maximum number of companies allowed in the game 8
max_join_time Maximum amount of time (ticks) a client is allowed to join 500
max_spectators Maximum number of spectators allowed on the server 10
min_active_clients Automatically pause the game when the number of active players is less than this amount. 0
net_frame_freq Number of frames before a command will be (visibly) executed 1
net_sync_freq Number of frames to check if the game is still in sync 100
pause_on_join Set if the server should pause gameplay while a client is joining. This might help slow users. on
rcon_pw Remote connection password, used to modify a server while connected as a client. Use '*' to disable rcon.

restart_game_year Auto-restart the server when Jan 1st of the set year is reached. Use '0' to disable this. 0
server_advertise Set if the server will advertise to the master server and show up there. on
server_ip IP that the server binds to. Changes take effect the next time you start a server. Use 'all' or '0.0.0.0' to bind to any IP. 0.0.0.0
server_name Name of the server for multiplayer.

server_port Server port number; change this if your firewall interferes. Changes take effect the next time you start a server. 3979 (TCP & UDP)
server_password Server password to protect your server; only clients with the password can join. Use '*' to clear the password.

Other variables

Variable Description Default value
name Your name for multiplayer Player
company_pw Your company password; only clients with the password can join. Use '*' to clear the password.

developer Redirect debugging output from the console/command line to the ingame console (value '2'). 1

Pathfinder variables

See Yet Another Pathfinder (en) for YAPF tuning variables.