{{Table of contents}} {| 誰か和訳よろ…orz | style="background:none; border:0px" | The '''console''' allows you to see [[multiplayer]] chat history and to execute [[Wikipedia:DOS|DOS]]-style commands in [[OpenTTD]]. Most of the commands are used to configure multiplayer [[server|servers]]. __TOC__ | style="background:none; border:0px"| [[Image:console.png|none|frame|The OpenTTD Console]] |} ==Using the console== Open the console with the tilde key (~), located to the left of '1' on the main keyboard. On some international keyboards the symbol may differ (e.g. on the German keyboard it is ^ TWICE). There is also a "Toggle Console" option in the help menu. <br /> After the console is open, type in a command, such as "help" and press Enter. Tips: * Scroll the console with Shift+Up/Down or Shift+Pageup/Pagedown. [#ec1e0c35] * Scroll through the input history with the Up/Down arrow keys. [#e3fea549] * Make the console bigger with Ctrl+Enter. [#k145a1ff] * Paste text from the clipboard with the normal Ctrl+V (Windows only). [#rddb4c89] ==Console commands== Here is a list of all the console commands available in OpenTTD. Brackets [] mean "optional". A vertical line | means "or". The list is organized with the most useful commands at the top. This list is also available [[Console_Commands|alphabetically]]. ===Help commands=== {| border=1 width=100% !width="225"|Command !Description |- |help [<item>] |Display basic console help, specify <item> for help on that specific command or variable. |- |list_cmds [<filter>] |List all available commands, optionally only commands starting with <filter>. |- |list_vars [<filter>] |List all registered variables, optionally only commands starting with <filter>. |- |list_aliases |List all available [[Console_Aliases|aliases]]. |- |list_patches |List all [[patches|patch]] options. |} ===Game commands=== These commands work both in single player games and on servers. {| border=1 width=100% !width="225"|Command !Description |- |newgame |Start a new game. |- |restart |Restart the same game. |- |connect <host> |Connect to a network game running on <host>. Not availiable for the server. |- |save <nowiki><number | file></nowiki> |Saves the current game as <number> or <file>. |- |load <nowiki><number | file></nowiki> |Load the savegame <number> or <file>. |- |part |Quit a running game and go back to the intro menu. Not availiable for the server. |- |exit / quit |Quit the game. |} ===Server commands=== These commands are used to run a multiplayer game [[server]]. Some commands also work for connected clients. {| border=1 width=100% !width="225"|Command !Description !width="90"|Clients |- |kick <nowiki><ip | client-id></nowiki> |Kick the client with IP <ip> or id <client-id>. |- |ban <nowiki><ip | client-id></nowiki> |Ban the client with IP <ip> or id <client-id>. |- |unban <ip> |Remove a ban on <ip>. |- |banlist |List banned clients. |- |reset_company <company-id> |Delete the company identified by <company-id>. |- |pause |Pause a network game. |- |unpause |Unpause a network game. |- |clients |Lists client id, name, company id, and IP address of each client. |Yes |- |players |Show a list of players and their attributes, e.g. company name, loan value, number of vehicles etc. |- |status |Get the status information on all currently connected clients. |- |server_info |List current and maximum client/player limits. |- |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 |} ===File handling commands=== {| border=1 width=100% !width="225"|Command !Description |- |cd <nowiki><directory | number></nowiki> |Change the working directory to <directory> or <number>. |- |ls / dir |List files of current directory. |- |pwd |Print out the current working directory. |- |rm <nowiki><number | file></nowiki> |Remove a savegame by name or index. |} {| border=1 width=100% !width="225"|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. |} ===Other commands=== {| border=1 width=100% !width="225"|Command !Description |- |screenshot <nowiki>[big | nocon]</nowiki> |Takes a screenshot. 'big' makes a screenshot of the whole map. 'nocon' hides the console for a normal screenshot. |- |alias <name> <command> |Create an [[Console_Aliases|alias]] named <name> bound to <command>. |- |patch <patchname> [<newvalue>] |Get and set the patch settings from the console. If <newvalue> is ommitted the current value is printed. See [[Console_Settings|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 |Clears the console screen. |- |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 <commmand>. |- |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 [[wikipedia:variable|variables]] available in OpenTTD. See the value of a variable by typing its name. Change the value by typing its name followed by the new value. Set [[wikipedia:Boolean_datatype|boolean]] variables with 'on' or 'off'. Reset a text variable to empty by using * as new value. ===Server variables=== {| border=1 width="100%" !width="225"|Variable !Description !width="90"|Default value |- |autoclean_companies |Automatically shut down inactive companies to free them up for other players. Customize with 'autoclean_(un)protected' |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 |- |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_players |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_pw |Server password to protect your server; only clients with the password can join. Use '*' to clear the password. |} ===Other variables=== {| border=1 width="100%" !width="225"|Variable !Description !width="90"|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 | [[Category:マニュアル]] IP:125.193.185.154 TIME:"2008-07-24 (木) 16:04:52" REFERER:"http://bunga.main.jp/openttd/index.php?cmd=edit&page=%A5%DE%A5%CB%A5%E5%A5%A2%A5%EB%2FConsole" USER_AGENT:"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727)"