Difference between revisions of "CommandMode"
From The Battle for Wesnoth Wiki
(→Command Mode) |
m (→Command Mode: added note about :inspect) |
||
Line 76: | Line 76: | ||
;<nowiki>:throw/fire</nowiki> ''event_name'' | ;<nowiki>:throw/fire</nowiki> ''event_name'' | ||
:throw an event by name, like ''time over'' or ''enemies defeated''. (Only available in 1.3.5 or later.) | :throw an event by name, like ''time over'' or ''enemies defeated''. (Only available in 1.3.5 or later.) | ||
+ | ;<nowiki>:inspect</nowiki> | ||
+ | :{{DevFeature}} show a gamestate inspector dialog which allows to see variable info, team info, ai info. | ||
;<nowiki>:cl</nowiki> | ;<nowiki>:cl</nowiki> | ||
:pops up a menu that allows you to move directly to a specified scenario. | :pops up a menu that allows you to move directly to a specified scenario. |
Revision as of 21:33, 25 October 2009
Command Mode
You can access command mode by typing ' : ' in a single player or multiplayer scenario. (Prior to version 1.1.1, you need to type shift - semicolon( ; ). However this isn't possible on all keyboards; if your keyboard doesn't have ':' above ';' you can change the hotkey in the Preferences, or you could edit game.cfg by hand.')
Note: you can highlight, copy, and paste text in debug mode.
Several vi-like commands are available in command mode. They are defined in menu_events.cpp. In the 1.5 branch, there is a :help command that lists all available commands, and :help foo displays more info about command foo. This is more reliable than the list that follows here:
- :q or :q!
- quit the scenario (without prompting)
- :w
- save the game (without prompting)
- :wq
- save the game and quit the scenario (without prompting)
- :refresh
- redraw the screen
- :droid [side] [on|off]
- toggle player on side between human and AI player. The player/client who controls that side needs to issue this command. If you don't provide side, the current side is assumed.
- :muteall
- toggles muting/silencing of all observers on/off
- :mute [username]
- mute a specific observer. If no username is supplied the muted usernames are displayed.
- :unmute [username]
- unmute a specific observer. If no username is given everyone is unmuted. (Doesn't effect the muteall setting.)
- :kick username
- kick a user in multiplayer. They will be able to rejoin the game. Generally a friendly way to remove someone who is having connection or other difficulties.
- :ban username
- kick and ban a user in multiplayer by the IP address used by that username. Can be used on users not in the game but on the server. (Of course they won't be kicked then.)
- :unban username
- unban a user by the IP address used by that username. Can be used on users not in the game but on the server.
- :control side username
- change the controller for side (write here the number of the side, the side must be controlled by you) to username (write here the nick of the player or observer)
- :clear
- clear chat messages
- :debug
- switch debug mode on (does not work in multiplayer). Debug mode is turned off by quitting the game or using the :nodebug command.
- :theme
- bring up theme selection menu
- :nosaves
- turns off the autosave function
- :show_coordinates (or :sc)
- Overlay x,y coordinates on map tiles. 1.5.5 onwards
- :show_terrain_codes (or :tc)
- Overlay terrain codes on visible map tiles. 1.5.5 onwards
- :lua statement
- Template:DevFeature execute a Lua statement
Extra Debugging Commands
DebugMode enables additional commands in command mode:
- :nodebug
- disables debug-mode commands
- :n
- skip to next scenario by triggering a win event
- :shroud
- toggles shroud on/off (implemented since 1.3.10)
- :fog
- toggles fog on/off (implemented since 1.3.10)
- :gold amount
- add amount gold to the current player's side
- :create unit_type
- create a unit of type specified at last selected hex
- :unit hitpoints=amount
- edit units hitpoints
- :unit experience=amount
- edit units experience
- :unit attribute=value
- when a unit is selected, this will set the unit's attribute to value. See SingleUnitWML for possible values.
- :unit advances=N
- Template:DevFeature when a unit is selected, this will advance (level up) the unit N times.
- :set_var attribute=value
- this will set a WML variable to a given value
- :show_var attribute
- this will display a popup with the content of the variable
- :throw/fire event_name
- throw an event by name, like time over or enemies defeated. (Only available in 1.3.5 or later.)
- :inspect
- Template:DevFeature show a gamestate inspector dialog which allows to see variable info, team info, ai info.
- :cl
- pops up a menu that allows you to move directly to a specified scenario.
- :version
- Report version and SVN revision level.