Difference between revisions of "CommandMode"

From The Battle for Wesnoth Wiki
m (Command Mode)
(Make sites formating correct again. Please could someone have a look at the italic parts?)
Line 1: Line 1:
 
== Command Mode ==
 
== Command Mode ==
  
You can access command mode by typing ':' in a single player or multiplayer scenario.
+
You can access command mode by typing ' ''':''' ' in a single player or multiplayer scenario.
More accurately, you need to type shift - semicolon( ''';''' ).
+
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.'
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.
+
Several vi-like commands are available in command mode. They are defined in ''playturn.cpp'' in the ''turn_info::do_command()'' function:
They are defined in ''playturn.cpp'' in the ''turn_info::do_command()'' function:
 
 
* ''':q|| or ||:q!''' quit the scenario (without prompting)
 
* ''':q|| or ||:q!''' quit the scenario (without prompting)
 
* ''':w''' save the game (without prompting)
 
* ''':w''' save the game (without prompting)
Line 14: Line 10:
 
* ''':refresh''' redraw the screen
 
* ''':refresh''' redraw the screen
 
* ''':droid side''' toggle player on side between human and AI players
 
* ''':droid side''' toggle player on side between human and AI players
* ''':kick''' kick a user in multiplayer. They will be able to rejoin the game.
+
* ''':kick''' 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.
Generally a friendly way to remove someone who is having connection or other difficulties.
 
 
* ''':ban''' kick and ban a user in multiplayer, and the IP address used by that username
 
* ''':ban''' kick and ban a user in multiplayer, and the IP address used by that username
 
* ''':control ''side'' ''player//''' change the controller for ''side'' to ''player''
 
* ''':control ''side'' ''player//''' change the controller for ''side'' to ''player''
Line 27: Line 22:
 
* ''':gold ''amount//''' add ''amount'' gold to the current player's side
 
* ''':gold ''amount//''' add ''amount'' gold to the current player's side
 
* ''':create ''unit_type''''' create a unit of type specified at last selected hex
 
* ''':create ''unit_type''''' create a unit of type specified at last selected hex
* ''':unit ''attribute//=//value''''' when a unit is selected, this will set
+
* ''':unit ''attribute//=//value''''' when a unit is selected, this will set the unit's ''attribute'' to ''value''. See [[SingleUnitWML]] for possible values.
the unit's ''attribute'' to ''value''.
 
See [[SingleUnitWML]] for possible values.
 
  
 
== See Also ==
 
== See Also ==

Revision as of 11:35, 14 August 2005

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:

  • :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 toggle player on side between human and AI players
  • :kick 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 kick and ban a user in multiplayer, and the IP address used by that username
  • :control side player// change the controller for side to player
  • :clear clear chat messages
  • :debug switch debug mode on
  • :debug off switch debug mode off
  • :theme bring up theme selection menu

DebugMode enables additional commands in command mode:

  • :n skip to next scenario by triggering a win event
  • :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 attribute//=//value when a unit is selected, this will set the unit's attribute to value. See SingleUnitWML for possible values.

See Also