Difference between revisions of "CommandMode"

From The Battle for Wesnoth Wiki
(Command Mode)
m (automated change of forum links)
Line 5: Line 5:
  
 
Several vi-like commands are available in command mode. They are defined in ''playturn.cpp'' in the ''turn_info::do_command()'' function:
 
Several vi-like commands are available in command mode. They are defined in ''playturn.cpp'' in the ''turn_info::do_command()'' function:
;<nowiki>:q or :q!</nowiki>
+
;&lt;nowiki&gt;:q or :q!&lt;/nowiki&gt;
 
:quit the scenario (without prompting)
 
:quit the scenario (without prompting)
;<nowiki>:w</nowiki>
+
;&lt;nowiki&gt;:w&lt;/nowiki&gt;
 
:save the game (without prompting)
 
:save the game (without prompting)
;<nowiki>:wq</nowiki>
+
;&lt;nowiki&gt;:wq&lt;/nowiki&gt;
 
:save the game and quit the scenario (without prompting)
 
:save the game and quit the scenario (without prompting)
;<nowiki>:refresh</nowiki>
+
;&lt;nowiki&gt;:refresh&lt;/nowiki&gt;
 
:redraw the screen
 
:redraw the screen
;<nowiki>:droid</nowiki> ''side''
+
;&lt;nowiki&gt;:droid&lt;/nowiki&gt; ''side''
 
:toggle player on side between human and AI players. If a human controls the side, the player himself has to issue this command.
 
:toggle player on side between human and AI players. If a human controls the side, the player himself has to issue this command.
;<nowiki>:kick</nowiki> ''username''
+
;&lt;nowiki&gt;:kick&lt;/nowiki&gt; ''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.
 
: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.
;<nowiki>:ban</nowiki> ''username''
+
;&lt;nowiki&gt;:ban&lt;/nowiki&gt; ''username''
 
:kick and ban a user in multiplayer, and the IP address used by that username
 
:kick and ban a user in multiplayer, and the IP address used by that username
;<nowiki>:control</nowiki> ''side'' ''username''
+
;&lt;nowiki&gt;:control&lt;/nowiki&gt; ''side'' ''username''
 
:change the controller for ''side'' (write here number of the side) to ''username'' (write here nick of player or observer)
 
:change the controller for ''side'' (write here number of the side) to ''username'' (write here nick of player or observer)
;<nowiki>:clear</nowiki>
+
;&lt;nowiki&gt;:clear&lt;/nowiki&gt;
 
:clear chat messages
 
:clear chat messages
;<nowiki>:debug</nowiki>
+
;&lt;nowiki&gt;:debug&lt;/nowiki&gt;
 
:switch debug mode on (does not work in multiplayer).  Debug mode is turned off by quitting the game.
 
:switch debug mode on (does not work in multiplayer).  Debug mode is turned off by quitting the game.
;<nowiki>:theme</nowiki>
+
;&lt;nowiki&gt;:theme&lt;/nowiki&gt;
 
:bring up theme selection menu
 
:bring up theme selection menu
  
Line 31: Line 31:
 
[[DebugMode]] enables additional commands in command mode:
 
[[DebugMode]] enables additional commands in command mode:
  
;<nowiki>:n</nowiki>
+
;&lt;nowiki&gt;:n&lt;/nowiki&gt;
 
:skip to next scenario by triggering a win event
 
:skip to next scenario by triggering a win event
;<nowiki>:gold</nowiki> ''amount''
+
;&lt;nowiki&gt;:gold&lt;/nowiki&gt; ''amount''
 
:add ''amount'' gold to the current player's side
 
:add ''amount'' gold to the current player's side
;<nowiki>:create</nowiki> ''unit_type''
+
;&lt;nowiki&gt;:create&lt;/nowiki&gt; ''unit_type''
 
:create a unit of type specified at last selected hex
 
:create a unit of type specified at last selected hex
;<nowiki>:unit</nowiki> ''attribute=value''
+
;&lt;nowiki&gt;:unit&lt;/nowiki&gt; ''attribute=value''
 
:when a unit is selected, this will set the unit's ''attribute'' to ''value''.  See [[SingleUnitWML]] for possible values.
 
:when a unit is selected, this will set the unit's ''attribute'' to ''value''.  See [[SingleUnitWML]] for possible values.
  

Revision as of 16:33, 21 January 2006

Command Mode

You can access command mode by typing ' : ' in a single player or multiplayer scenario. More accurately, 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.'

Several vi-like commands are available in command mode. They are defined in playturn.cpp in the turn_info::do_command() function:

<nowiki>
q or :q!</nowiki>
quit the scenario (without prompting)
<nowiki>
w</nowiki>
save the game (without prompting)
<nowiki>
wq</nowiki>
save the game and quit the scenario (without prompting)
<nowiki>
refresh</nowiki>
redraw the screen
<nowiki>
droid</nowiki> side
toggle player on side between human and AI players. If a human controls the side, the player himself has to issue this command.
<nowiki>
kick</nowiki> 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.
<nowiki>
ban</nowiki> username
kick and ban a user in multiplayer, and the IP address used by that username
<nowiki>
control</nowiki> side username
change the controller for side (write here number of the side) to username (write here nick of player or observer)
<nowiki>
clear</nowiki>
clear chat messages
<nowiki>
debug</nowiki>
switch debug mode on (does not work in multiplayer). Debug mode is turned off by quitting the game.
<nowiki>
theme</nowiki>
bring up theme selection menu

Extra Debugging Commands

DebugMode enables additional commands in command mode:

<nowiki>
n</nowiki>
skip to next scenario by triggering a win event
<nowiki>
gold</nowiki> amount
add amount gold to the current player's side
<nowiki>
create</nowiki> unit_type
create a unit of type specified at last selected hex
<nowiki>
unit</nowiki> attribute=value
when a unit is selected, this will set the unit's attribute to value. See SingleUnitWML for possible values.

See Also