CINXE.COM

CommandMode - The Battle for Wesnoth Wiki

<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"/> <title>CommandMode - The Battle for Wesnoth Wiki</title> <script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"CommandMode","wgTitle":"CommandMode","wgCurRevisionId":71166,"wgRevisionId":71166,"wgArticleId":1352,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Playing Wesnoth","Development"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"CommandMode","wgRelevantArticleId":1352,"wgRequestId":"6c9bd3872e44504186abf08e","wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgWikiEditorEnabledModules":[]});mw.loader.state({"site.styles":"ready","noscript":"ready","user.styles":"ready","user":"ready","user.options":"ready","user.tokens":"loading","ext.CookieWarning.styles":"ready","mediawiki.legacy.shared":"ready","mediawiki.legacy.commonPrint":"ready","mediawiki.sectionAnchor":"ready"});mw.loader.implement("user.tokens@15y0z4f",function($,jQuery,require,module){/*@nomin*/mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); });mw.loader.load(["site","mediawiki.page.startup","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.toc","mediawiki.searchSuggest","ext.CookieWarning","skins.wesmere.js"]);});</script> <link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=ext.CookieWarning.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor&amp;only=styles&amp;skin=Wesmere"/> <script async="" src="/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=Wesmere"></script> <meta name="ResourceLoaderDynamicStyles" content=""/> <link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=Wesmere"/> <meta name="generator" content="MediaWiki 1.31.16"/> <meta name="description" content="You can access command mode by typing : (colon) in a single-player or multiplayer scenario."/> <link rel="shortcut icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="The Battle for Wesnoth Wiki (en)"/> <link rel="EditURI" type="application/rsd+xml" href="https://wiki.wesnoth.org/api.php?action=rsd"/> <link rel="alternate" type="application/atom+xml" title="The Battle for Wesnoth Wiki Atom feed" href="/index.php?title=Special:RecentChanges&amp;feed=atom"/> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="stylesheet" type="text/css" href="https://www.wesnoth.org/wesmere/css/wesmere-1.2.0.css" /> <script src="https://www.wesnoth.org/wesmere/js/modernizr.js"></script> <link rel="apple-touch-icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/apple-touch-icon.png" sizes="180x180" /> <link rel="icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/favicon-32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/favicon-16.png" sizes="16x16" /> <meta name="theme-color" content="#0f1421" /> <!--[if lt IE 9]><script src="/load.php?debug=false&amp;lang=en&amp;modules=html5shiv&amp;only=scripts&amp;skin=Wesmere&amp;sync=1"></script><![endif]--> </head> <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-CommandMode rootpage-CommandMode skin-Wesmere action-view"><div class="mw-cookiewarning-container"><div class="mw-cookiewarning-text"><span>Cookies help us deliver our services. By using our services, you agree to our use of cookies.</span><form method="POST"><input name="disablecookiewarning" class="mw-cookiewarning-dismiss" type="submit" value="OK"/></form></div></div> <div id="main"> <div id="nav" role="banner"> <div class="centerbox"> <div id="logo"> <a href="https://www.wesnoth.org/" aria-label="Wesnoth logo"></a> </div> <ul id="navlinks"> <li><a href="https://www.wesnoth.org/">Home</a></li> <li><a href="https://forums.wesnoth.org/viewforum.php?f=62">News</a></li> <li><a href="https://wiki.wesnoth.org/Play">Play</a></li> <li><a href="https://wiki.wesnoth.org/Create">Create</a></li> <li><a href="https://forums.wesnoth.org/">Forums</a></li> <li><a href="https://wiki.wesnoth.org/Project">About</a></li> </ul> <div id="sitesearch" role="search"> <form method="get" action="/index.php"> <input id="searchbox" type="search" name="search" placeholder="Search" value="" title="Search this wiki [Alt+Shift+f]" accesskey="f" /> <span id="searchbox-controls"> <button id="search-go" class="search-button" type="submit" title="Search"> <i class="search-icon" aria-hidden="true"></i> <span class="sr-label">Search this wiki</span> </button> </span> </form> </div> <div class="reset"></div> </div> </div> <div id="content" class="mw-content" role="main"> <a id="top"></a> <div id="wm-wiki-toolbar" role="toolbar"><ul class="wm-toolbar" role="toolbar" aria-label="Wiki"><li id="ca-nstab-main" class="selected"><a href="/CommandMode" role="button" title="View the content page [c]" accesskey="c"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Page</span></a></li><li id="ca-talk"><a href="/Talk:CommandMode" rel="discussion" role="button" title="Discussion about the content page [t]" accesskey="t"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Discussion</span></a></li><li id="ca-history"><a href="/index.php?title=CommandMode&amp;action=history" role="button" title="Past revisions of this page [h]" accesskey="h"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">History</span></a></li><li id="wm-places-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Places" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Places</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="n-mainpage-description"><a href="/Main_Page" role="menuitem" title="Visit the main page [z]" accesskey="z"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Main page</span></a></li><li id="n-recentchanges"><a href="/Special:RecentChanges" role="menuitem" title="A list of recent changes in the wiki [r]" accesskey="r"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Recent changes</span></a></li><li id="n-randompage"><a href="/Special:Random" role="menuitem" title="Load a random page [x]" accesskey="x"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Random page</span></a></li><li id="n-help-mediawiki"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" role="menuitem"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Help about MediaWiki</span></a></li></ul><li id="wm-advanced-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Advanced" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Advanced</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="ca-viewsource"><a href="/index.php?title=CommandMode&amp;action=edit" role="menuitem" title="This page is protected.&#10;You can view its source [e]" accesskey="e"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>View source</span></a></li><li id="t-whatlinkshere"><a href="/Special:WhatLinksHere/CommandMode" role="menuitem" title="A list of all wiki pages that link here [j]" accesskey="j"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>What links here</span></a></li><li id="t-recentchangeslinked"><a href="/Special:RecentChangesLinked/CommandMode" rel="nofollow" role="menuitem" title="Recent changes in pages linked from this page [k]" accesskey="k"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Related changes</span></a></li><li id="t-specialpages"><a href="/Special:SpecialPages" role="menuitem" title="A list of all special pages [q]" accesskey="q"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Special pages</span></a></li><li id="t-permalink"><a href="/index.php?title=CommandMode&amp;oldid=71166" role="menuitem" title="Permanent link to this revision of the page"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Permanent link</span></a></li><li id="t-info"><a href="/index.php?title=CommandMode&amp;action=info" role="menuitem" title="More information about this page"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Page information</span></a></li></ul></ul><ul class="wm-toolbar" role="toolbar" aria-label="User"><li id="wm-account-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Your account" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Not logged in</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="pt-login"><a href="/index.php?title=Special:UserLogin&amp;returnto=CommandMode" role="menuitem" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Log in</span></a></li></ul></ul></div> <!-- wm-wiki-toolbar --> <h1 class="firstHeading" lang="en">CommandMode</h1> <div id="bodyContent"> <div id="siteSub">From The Battle for Wesnoth Wiki</div> <div id="contentSub"></div> <!-- start wikipage --> <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><div class="wikilangbox"> <div class="wikilangs-caption" title="Other languages"><a href="/Template:Translations" title="Template:Translations"><i class="fa fa-2x fa-globe"></i><span class="sr-label">Other languages:</span></a></div> <div class="wikilangs"> <ul><li><a class="mw-selflink selflink">English</a></li><li><a href="/CommandMode/de" title="CommandMode/de">Deutsch</a></li><li><a href="/CommandMode/ru" title="CommandMode/ru">Русский</a></li></ul> </div> </div> <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div> <ul> <li class="toclevel-1 tocsection-1"><a href="#Command_Mode"><span class="tocnumber">1</span> <span class="toctext">Command Mode</span></a> <ul> <li class="toclevel-2 tocsection-2"><a href="#Extra_Debugging_Commands"><span class="tocnumber">1.1</span> <span class="toctext">Extra Debugging Commands</span></a></li> </ul> </li> <li class="toclevel-1 tocsection-3"><a href="#See_Also"><span class="tocnumber">2</span> <span class="toctext">See Also</span></a></li> </ul> </div> <h2><span class="mw-headline" id="Command_Mode">Command Mode</span></h2> <p>You can access command mode by typing <b>:</b> (colon) in a single-player or multiplayer scenario. </p><p>If typing a colon is not feasible in your keyboard layout, you can reassign the hotkey in Preferences, or edit <i>game.cfg</i>. </p><p><i>Note: It is possible to highlight, copy, and paste text in the command entry field.</i> </p><p>Several vi-like commands are available in command mode. They are defined in <i>menu_events.cpp</i>. There is a <b>:help</b> command that lists all available commands, and <b>:help <i>foo</i></b> displays more information about command <i>foo</i>. This is more reliable than the list that follows here: </p> <dl><dt>:q!</dt> <dd>quit the scenario (without prompting)</dd> <dt>:w</dt> <dd>save the game (without prompting)</dd> <dt>:wq</dt> <dd>save the game and quit the scenario (without prompting)</dd> <dt>:refresh</dt> <dd>redraw the screen</dd> <dt>:droid <i>side</i> on|off|full</dt> <dd><b>on</b> lets the AI make moves for <b>side</b>. The player still sees the vision (fog of war and shroud) for <b>side</b> from the start of its turn until the start of the next turn for another side that the same player controls.</dd> <dd><b>off</b> lets the player make moves for <b>side</b>.</dd> <dd><b>full</b> lets the AI have full control of <b>side</b> <i><b>(<a href="/DevFeature" title="DevFeature">Version 1.15.0 and later only</a>)</b></i>. If the player controls another side then their vision does not switch to the droided side's vision.</dd> <dd>The player/client who controls that side needs to issue this command.</dd> <dd><b>NOTE:</b> If the only surviving side of a campaign scenario has been given to the AI by the <b>full</b> option, the game will not advance to the next scenario of the campaign.</dd> <dt>:idle [<i>side</i>] [on|off]</dt> <dd>toggle player side between idle mode and not. This command should normally be needed only for debugging purposes.</dd> <dt>:controller [<i>side</i>]</dt> <dd>debugging command which displays the current controller type of a side.</dd> <dt>:muteall</dt> <dd>toggles muting/silencing of all observers on/off</dd> <dt>:mute [<i>username</i>]</dt> <dd>mute a specific observer. If no <i>username</i> is supplied the muted usernames are displayed.</dd> <dt>:unmute [<i>username</i>]</dt> <dd>unmute a specific observer. If no <i>username</i> is given everyone is unmuted. (Doesn't effect the muteall setting.)</dd> <dt>:kick <i>username</i></dt> <dd>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.</dd> <dt>:ban <i>username</i></dt> <dd>kick and ban a user in multiplayer by the IP address used by that <i>username</i>. Can be used on users not in the game but on the server. (Of course they won't be kicked then.)</dd> <dt>:unban <i>username</i></dt> <dd>unban a user by the IP address used by that <i>username</i>. Can be used on users not in the game but on the server.</dd> <dt>:control <i>side</i> <i>username</i></dt> <dd>change the controller for <i>side</i> (write here the number of the side, the side must be controlled by you) to <i>username</i> (write here the nick of the player or observer)</dd> <dt>:give_control</dt> <dd>launch a friendly gui to assist with assigning control of sides to players</dd> <dt>:clear</dt> <dd>clear chat messages. Also possible with ctrl+x</dd> <dt>:debug</dt> <dd>switch debug mode on (does not work in multiplayer). Debug mode is turned off by quitting the game or using the&#160;:nodebug command.</dd> <dt>:theme</dt> <dd>bring up theme selection menu</dd> <dt>:nosaves</dt> <dd>turns off the autosave function</dd> <dt>:show_coordinates (or :sc)</dt> <dd>Overlay x,y coordinates on map tiles.</dd> <dt>:show_terrain_codes (or :tc)</dt> <dd>Overlay terrain codes on visible map tiles.</dd> <dt>:discover/undiscover</dt> <dd>Show all hidden unit descriptions in the in-game Help, or forget the known ones.</dd></dl> <h3><span class="mw-headline" id="Extra_Debugging_Commands">Extra Debugging Commands</span></h3> <p><a href="/DebugMode" title="DebugMode">DebugMode</a> (:debug) enables additional commands in command mode: </p> <dl><dt>:lua <i>statement</i></dt> <dd>execute a Lua statement</dd> <dt>:nodebug</dt> <dd>disables debug-mode commands</dd> <dt>:n/next_level</dt> <dd>skip to next scenario by triggering a win event</dd> <dt>:cl/choose_level</dt> <dd>pops up a menu that allows you to move directly to a specified scenario.</dd> <dt>:shroud</dt> <dd>toggles shroud on/off</dd> <dt>:fog</dt> <dd>toggles fog on/off</dd> <dt>:gold <i>amount</i></dt> <dd>add <i>amount</i> gold to the current player's side</dd> <dt>:create <i>unit_type</i></dt> <dd>create a unit of type specified at last selected hex</dd> <dt>:unit hitpoints=<i>amount</i></dt> <dd>edit units hitpoints</dd> <dt>:unit experience=<i>amount</i></dt> <dd>edit units experience</dd> <dt>:unit <i>attribute=value</i></dt> <dd>when a unit is selected, this will set the unit's <i>attribute</i> to <i>value</i>. See <a href="/SingleUnitWML" title="SingleUnitWML">SingleUnitWML</a> for possible values.</dd> <dt>:unit <i>advances=N</i></dt> <dd>when a unit is selected, this will advance (level up) the unit N times.</dd> <dt>:unit <i>status=petrified,-slow</i></dt> <dd><i><b>(<a href="/DevFeature" title="DevFeature">Version 1.13.2 and later only</a>)</b></i> sets or unsets statuses on a unit; put a - in front of the status to unset it.</dd> <dt>:unit <i>invulnerable=yes</i></dt> <dd><i><b>(<a href="/DevFeature" title="DevFeature">Version 1.13.6 and later only</a>)</b></i> makes the selected unit invulnerable. Can also be done via :unit status=invulnerable</dd> <dt>:set_var <i>attribute=value</i></dt> <dd>this will set a WML variable to a given value</dd> <dt>:show_var <i>attribute</i></dt> <dd>this will display a popup with the content of the variable</dd> <dt>:throw/fire <i>event_name</i></dt> <dd>throw an event by name, like <i>time over</i> or <i>enemies defeated</i>.</dd> <dt>:inspect</dt> <dd>show a gamestate inspector dialog which allows to see variable info, team info, ai info.</dd> <dt>:turn [<i>number</i>]</dt> <dd>change the current turn to the specified number. If no number is provided, the turn number is increased by one.</dd> <dt>:turn_limit [<i>number</i>]</dt> <dd>change the turn limit for the current scenario to the specified number. If no number is provided, or it is -1, the turn limit is switched off.</dd> <dt>:version</dt> <dd>Report the release version and repository revision level.</dd></dl> <h2><span class="mw-headline" id="See_Also">See Also</span></h2> <ul><li><a href="/DebugMode" title="DebugMode">DebugMode</a></li> <li><a href="/ChatCommands" title="ChatCommands">ChatCommands</a></li> <li><a href="/ServerAdministration" title="ServerAdministration">ServerAdministration</a></li> <li><a href="/DeveloperResources" class="mw-redirect" title="DeveloperResources">DeveloperResources</a></li></ul> <!-- NewPP limit report Cached time: 20241127084604 Cache expiry: 86400 Dynamic content: false CPU time usage: 0.018 seconds Real time usage: 0.021 seconds Preprocessor visited node count: 619/1000000 Preprocessor generated node count: 1363/1000000 Post‐expand include size: 1173/2097152 bytes Template argument size: 76/2097152 bytes Highest expansion depth: 5/40 Expensive parser function count: 18/100 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 396/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 11.754 1 -total 70.20% 8.251 1 Template:Translations 53.93% 6.339 18 Template:TranslationsHelper 9.33% 1.096 2 Template:DevFeature1.13 9.03% 1.061 1 Template:DevFeature1.15 --> </div> <!-- Saved in parser cache with key wiki-mw_:pcache:idhash:1352-0!canonical and timestamp 20241127084604 and revision id 71166 --> </div> <!-- end wikipage --> <div class="printfooter"> Retrieved from "<a dir="ltr" href="https://wiki.wesnoth.org/index.php?title=CommandMode&amp;oldid=71166">https://wiki.wesnoth.org/index.php?title=CommandMode&amp;oldid=71166</a>" </div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/Category:Playing_Wesnoth" title="Category:Playing Wesnoth">Playing Wesnoth</a></li><li><a href="/Category:Development" title="Category:Development">Development</a></li></ul></div></div><div id="lastmod"> This page was last edited on 10 May 2023, at 15:03.</div> <div class="visualClear"></div> </div> <!-- bodyContent --> </div> <!-- end content --> </div> <!-- end main --> <div id="footer-sep"></div> <div id="footer"><div id="footer-content"><div> <a href="https://wiki.wesnoth.org/StartingPoints">Site Map</a> &#8226; <a href="https://status.wesnoth.org/">Site Status</a><br /> Copyright &copy; 2003&ndash;2024 by <a rel="author" href="https://wiki.wesnoth.org/Project">The Battle for Wesnoth Project</a> — Powered by <a href="https://www.mediawiki.org/">MediaWiki</a><br /> Site design Copyright &copy; 2017&ndash;2024 by Iris Morelle </div></div></div> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.018","walltime":"0.021","ppvisitednodes":{"value":619,"limit":1000000},"ppgeneratednodes":{"value":1363,"limit":1000000},"postexpandincludesize":{"value":1173,"limit":2097152},"templateargumentsize":{"value":76,"limit":2097152},"expansiondepth":{"value":5,"limit":40},"expensivefunctioncount":{"value":18,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":396,"limit":5000000},"timingprofile":["100.00% 11.754 1 -total"," 70.20% 8.251 1 Template:Translations"," 53.93% 6.339 18 Template:TranslationsHelper"," 9.33% 1.096 2 Template:DevFeature1.13"," 9.03% 1.061 1 Template:DevFeature1.15"]},"cachereport":{"timestamp":"20241127084604","ttl":86400,"transientcontent":false}}});});</script><script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":24});});</script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10