Console Commands

From Official Barotrauma Wiki
Jump to: navigation, search
Version Checkmark False.png
Data is Potentially Outdated

Last updated for version v0.16.7.0
The current game version is v0.17.15.0

See also: Permissions

This page is about the debugging tool; for the in-game installation, see "Terminal"

The console is a debugging tool that can be used to view errors and change certain settings and content while the game is opened.

Its main function is debugging, but it can also be used to spawn items and creatures, modify their attributes and afflictions, or use moderation commands.

In multiplayer, players that have the "ConsoleCommands" permission can use certain specific commands under the "Permitted console commands" part of the permissions menu. Players can input commands in a text input field at the bottom of the console window.

The source code related to console commands is available on Barotrauma's official Github page.

Usage

  1. Press F3 to toggle the console.
  2. Enter enablecheats to enable cheats and disable achievements for the game session
    • This is only required for cheat commands, marked with a green checkmark in the table below.
  3. Press Tab ↹ to autofill and cycle through identifiers


Examples:

spawnitem weld
...then press Tab ↹ to cycle between "Welding Tool" and "Welding Fuel"


setskill mech
...then press Tab ↹ to autofill Mechanical


In-game help with commands can be accessed with the help command. Enter help before a command for help with a specific command (i.e. help spawnitem), or by itself for a list of all commands.

Commands

Arguments are typed without brackets, and with quotation marks around multi-word inputs. Examples: handcuffs and "handheld sonar"
Click on the headers to sort this table by type or by command name. Alternatively, use CTRL+F to find a specific command.
Category Cheat Command Description
Campaign Version Checkmark False.png campaigndestination [index] Set the target location in the current campaign.
Version Checkmark False.png campaigninfo Display info about the current campaign, such as current money, location and available destinations.
Version Checkmark True.png setlocationreputation [value] Set your reputation to the current location to the specified value.
Version Checkmark True.png togglecampaignteleport Toggles the ability to teleport to a location on the campaign map by double-clicking. Works only in singleplayer.
Version Checkmark False.png pause Pauses the game. Only works in singleplayer.
Moderation Version Checkmark False.png ban [character name] Bans the selected character from the server.
Version Checkmark False.png banendpoint [IP Address/SteamID] Bans the selected IP Address/SteamID from the server.
Version Checkmark False.png banid [clientID] Bans the selected clientID from the server.
Version Checkmark False.png bindkey [key] [command] Binds a key to a command.
Version Checkmark False.png clientlist Outputs the character name, clientID and ping of all players in the server to the console.
Version Checkmark False.png givecommandperm [clientID/SteamID/character name/IP Address] Gives the selected player the permission to use the console commands typed in the next entry.
Version Checkmark False.png giveperm [clientID/SteamID/character name/IP Address] Gives the selected player the permission typed in the next entry.
Version Checkmark False.png giverank [clientID/SteamID/character name/IP Address] Gives the selected player the rank typed in the next entry.
Version Checkmark False.png kick [character name] Kicks the selected character from the server.
Version Checkmark False.png kickid [clientID] Kicks the selected clientID from the server.
Version Checkmark False.png killdisconnectedtimer [seconds] Set the delay until disconnected players are killed.
Version Checkmark False.png msg [message] Send a chat message with no sender specified.
Version Checkmark False.png mute [character name] Blocks a character from speaking through voice chat.
Version Checkmark False.png resetkarma [clientID] Resets the karma of a client to 100.
Version Checkmark False.png revokecommandperm [clientID/SteamID/character name/IP Address] Revokes the selected player's permission to use the console commands typed in the next entry.
Version Checkmark False.png revokeperm [clientID/SteamID/character name/IP Address] Revokes the selected player's permission typed in the next entry.
Version Checkmark False.png savebinds Writes current keybinds into the config file (= keybinds set using the keybind command).
Version Checkmark False.png say [message] Send a global chat message. When issued through the server command line, displays "HOST" as the sender.
Version Checkmark False.png sendchatmessage [sender name] [message] [message type 0-8] [red 0-255] [green 0-255] [blue 0-255] [alpha 0-255] Sends a chat message with specified type and color. Multiplayer ONLY
Version Checkmark False.png setkarma [clientID] [0-100] Sets the karma of a client to the specified value.
Version Checkmark False.png showkarma Outputs the karma of all players to the console.
Version Checkmark False.png showperm [clientID/SteamID/character name/IP Address] Outputs the permissions of the selected player to the console.
Version Checkmark False.png togglecharacternames Toggle visibility of names above players. Client-side only.
Version Checkmark False.png togglekarma Toggles the karma system on/off.
Version Checkmark False.png togglekarmatestmode Toggles the karma test mode on/off. When on, notifies players of a karma change and its reason, also disables karma bans.
Version Checkmark False.png unban [character name] Unbans the selected character from the server.
Version Checkmark False.png unbanip [IP Address] Unbans the selected IP Address from the server.
Version Checkmark False.png unbindkey [key] Unbinds a command previously bound using bindkey.
Version Checkmark False.png unmute [character name] Allows a character to speak through voice chat.
Server
Settings
Version Checkmark False.png autorestart [true/false] Enables/disables the round autorestart timer.
Version Checkmark False.png autorestartinterval [seconds] Sets the delay between rounds, if autorestart is enabled. Setting this to 0 disables autorestart.
Version Checkmark False.png autorestarttimer [seconds] Sets the current autorestart timer to the specified value.
Version Checkmark False.png botcount [0-16] Sets the amount of bots on the ship to the specified value.
Version Checkmark False.png botspawnmode [fill/normal] Set how bots are spawned on the ship.
Version Checkmark False.png difficulty [0-100] Sets the difficulty value of the server to the specified value.
Version Checkmark False.png startwhenclientsready [true/false] Enables/disables autorestart when all players are ready.
Cheats Version Checkmark True.png ballastflora infect Infects random pump (priority those tagged "ballast") with Ballast Flora
Version Checkmark True.png ballastflora growthwarp [number] Increases growth speed of Ballast Flora
Version Checkmark True.png control [charactername] Start controlling the specified character (client-only).
enablecheats Enables cheat commands and disables achievements for the game session.
Version Checkmark True.png explosion [range] [force] [damage] [structural damage] [item damage] [emp strength] Creates an explosion at the position of the cursor.
Version Checkmark True.png fire Creates fire at the position of the cursor.
Version Checkmark True.png fixwalls/fixhulls Fixes all walls on the ship.
Version Checkmark True.png fixitems Restores all items to max condition.
Version Checkmark True.png freecam Switches the game into spectator mode.
Version Checkmark True.png giveaffliction [affliction] [affliction strength] [character name] Applies an Affliction to the specified character. Affliction is applied to the controlled character if name is omitted.
Version Checkmark True.png giveexperience [amount] [character name] Gives experience to the specified character. Experience is given to the controlled character if name is omitted.
Version Checkmark True.png givetalent [talent] [character name] Grants a Talent to the specified character. Talent is granted to the controlled character if name is omitted.
Version Checkmark True.png godmode [character name] Makes the character invulnerable to damage. Controlled character is selected if name is omitted.
Version Checkmark True.png godmode_mainsub Makes the submarine invulnerable to damage.
Version Checkmark True.png growthdelay Sets how long it takes for planters to attempt to advance a plant's growth.
Version Checkmark True.png heal [character name] Restores the specified character to max health. Controlled character is healed if name is omitted.
Version Checkmark True.png kill [character] Immediately kills the specified character. Controlled character is killed if name is omitted.
Version Checkmark True.png killmonsters Immediately kills all AI-controlled enemies in the level.
Version Checkmark True.png lighting Toggles lighting on/off. Client-side only.
Version Checkmark True.png los Toggle line-of-sight occlusion on/off. Client-side only.
Version Checkmark True.png money [integer value] Adds the specified amount to the current balance in Marks
Version Checkmark True.png oxygen/air Replenishes every room's oxygen levels to 100%
Version Checkmark True.png power Immediately powers up all nuclear reactors.
Version Checkmark False.png respawnnow Trigger a respawn if there are clients waiting to respawn.
Version Checkmark True.png revive [character name] Brings the specified character back from the dead. Controlled character is revived if name is omitted.
Version Checkmark True.png setclientcharacter [client name] [character name] Give control of the specified character to the specified client.
Version Checkmark True.png setskill [all/indentifier] [max/level] [character name] Set specified skills of a specified client to a specified level.
Version Checkmark True.png spawn [creaturename/jobname] [near/inside/outside/cursor] Spawn a creature or AI-controlled crewmember at the specified location.
Version Checkmark True.png spawnitem [item name/identifier] [cursor/inventory/cargo/random/[character name]] Spawn an item at the specified location. Item is spawned at a random location if location is omitted.
Version Checkmark True.png teleportcharacter [character name] Teleports the specified character to the cursor's position.
Version Checkmark True.png teleportsub [start/end/cursor] Teleports the sub to a given location. Warning: Very glitchy.
Version Checkmark True.png upgradeitem [upgrade] [level] [items] Adds an upgrade to the targeted item.
Version Checkmark True.png water Toggles water editing. Add water to a room by holding left click, and drain water by holding right click.
Submarine
Editor
Version Checkmark True.png alpha [0-255] Set the alpha (transparency) of the selected items/structures.
Version Checkmark True.png color [0-255] [0-255] [0-255] Set the RGB values of the selected items/structures.
Version Checkmark False.png load [submarine name] Loads a submarine.
Version Checkmark False.png multiplylights [R,G,B,A] Multiplies the colors/alphas of all static lights in the sub using the specified Vector4 value. https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector4?view=netcore-3.1
Version Checkmark True.png reloadsprite Reloads the sprites of the selected items/structures. Also works in-game on the controlled character.
Version Checkmark False.png resetall Resets all items/structures to prefab defaults.
Version Checkmark False.png resetentitiesbyidentifier [identifier] Resets all items/structures with the given identifier to prefab defaults.
Version Checkmark False.png resetselected Resets the properties of the selected items/structures to prefab default.
Version Checkmark False.png save [submarine name] Saves the currently loaded submarine to ..\Barotrauma\Submarines\[submarine name]. Also works in singleplayer.
Version Checkmark False.png setentityproperties [property name] [value] Set the specified property of the selected items/structures to the specified value.
Version Checkmark False.png togglegrid Toggle visual snap grid in sub editor.
Misc Version Checkmark False.png quickstart [submarine name] [difficulty] [level seed] Starts a singleplayer sandbox (can only be executed from the main menu)
Version Checkmark False.png wikiimage_character Save an image of the currently controlled character with a transparent background.
Version Checkmark False.png wikiimage_sub Save an image of the main submarine with a transparent background.
Debug
Network
Version Checkmark False.png netstats Toggle visibility of the Network Statistics UI.
Version Checkmark False.png simulatedduplicateschance [0.00-1.00] Simulates packet duplication in network messages. A value of 1 means 100% of packets are duplicated.
Version Checkmark False.png simulatedlatency [min. latency (seconds)] [rand. latency (seconds)] Applies a simulated latency to network messages. Useful for testing real network conditions.
Version Checkmark False.png simulatedloss [0.00-1.00] Simulates packet loss in network messages. A value of 1 means 100% of packets are lost.
Version Checkmark False.png steamnetdebug Toggles Steamworks network debug logging.
Debug
In-game
Version Checkmark False.png autoitemplacerdebug Toggles automatic item placer debug info on/off. Auto-placed items are outputted to the console at round start.
Version Checkmark False.png calculatehashes [content package name] Show the MD5 hashes of the files in the specified content package. First content package is selected if name is omitted.
Version Checkmark False.png checkcrafting Checks item crafting and deconstruction recipes for inconsistencies.
Version Checkmark True.png debugai Toggles AI debug mode on/off. Only works in singleplayer.
Version Checkmark True.png debugdraw Toggles the debug drawing mode on/off. Client-side only.
Version Checkmark True.png disablecrewai Disables the AI of AI-controlled crewmembers.
Version Checkmark True.png disableenemyai Disables the AI of AI-controlled enemies.
Version Checkmark False.png dumpentitytexts [filename.txt] Writes the names and descriptions of every entity prefab along with xml translation tags to the specified .txt file. Data is written to Barotrauma\Content\Texts\EntityTexts.txt if file path is omitted.
Version Checkmark False.png dumpeventtexts [filename.txt] Writes the text of every event file along with xml translation tags to the specified .txt file. Data is written to Barotrauma\Content\Texts\EventTexts.txt if file path is omitted.
Version Checkmark False.png dumptexts [filename.xml] Writes the text of the specified .xml file to a .txt file with the same name. Data is read from EnglishVanilla.xml if file path is omitted.
Version Checkmark False.png dumptofile [filename] Outputs the contents of the debug console into a text file in the game folder. If the filename argument is omitted, "consoleOutput.txt" is used as the filename.
Version Checkmark False.png editcharacters Opens the Character Editor.
Version Checkmark False.png editevents Opens the Event Editor.
Version Checkmark False.png editlevels Opens the Level Editor
Version Checkmark False.png editparticles Opens the Particle Editor.
Version Checkmark False.png editsprites Opens the Sprite Editor.
Version Checkmark False.png editsubs/subeditor Opens the Submarine Editor.
Version Checkmark True.png enablecrewai Enables the AI of AI-controlled crewmembers.
Version Checkmark True.png enableenemyai Enables the AI of AI-controlled enemies.
Version Checkmark True.png eventmanager Toggles the master event manager on/off. Random events cannot happen if this is turned off.
Version Checkmark False.png findentityids [entity name] Outputs the entityID of the specified entity to the console.
Version Checkmark False.png fpscounter Toggles the in-game FPS counter on/off.
Version Checkmark False.png game Switch to the in-game view.
Version Checkmark True.png gender [Male/Female/None] Switches the gender of the controlled character to the specified value.
Version Checkmark True.png head [head id] [hair id] [beard id] [moustache id] [face attachment id] Loads a head sprite and wearables to a controlled character. Hair, beard, moustache and face attachment ID's are optional.
Version Checkmark False.png hud/togglehud Toggles the visibility of all the HUD elements. Client-side only.
Version Checkmark False.png hudlayoutdebugdraw Toggles the debug drawing mode of HUD layout areas on/off.
Version Checkmark True.png interactdebugdraw Toggles the debug drawing mode of item interaction ranges on/off.
Version Checkmark False.png itemlist/items Outputs all item prefabs available for spawning.
Version Checkmark True.png jointscale [value] [character name] Define the joint scaling for the specified character. Joint scaling is changed for the controlled character if name is omitted.
Version Checkmark True.png limbscale [value] [character name] Define the limb scaling for the specified character. Limb scaling is changed for the controlled character if name is omitted.
Version Checkmark False.png listtasks Outputs all asynchronous tasks currently in the task pool to the console.
Version Checkmark False.png loadtexts [sourcefile.txt] [destinationfile.xml] Loads all lines of text from a .txt file to a .xml file sequentially.
Version Checkmark True.png loadwearable [id] Force-select a certain job loadout variant for the controlled character.
Version Checkmark True.png lock Locks movement of the main submarine.
Version Checkmark True.png lockx Locks movement of the main submarine in the X (left-right) direction.
Version Checkmark True.png locky Locks movement of the main submarine in the Y (up-down) direction.
Version Checkmark False.png mainmenu/menu Switch to the main menu.
Version Checkmark False.png messagebox [header] [message] [default/in-game] Create a message box. Client-side only.
Version Checkmark True.png race [White, Black, Asian, None] Sets the race of the controlled character to the specified value.
Version Checkmark True.png ragdoll [character name] Ragdolls the specified character. Ragdolls controlled character if name is omitted.
Version Checkmark True.png ragdollscale [character name] Define the ragdoll scaling for the specified character. Ragdoll scaling is changed for the controlled character if name is omitted.
Version Checkmark True.png recreateragdoll [character name] Recreate the ragdoll for the specified character. Ragdoll is recreated for the controlled character if name is omitted.
Version Checkmark True.png reloadwearables [character name] Reloads the sprites of all limbs and clothes of the specified character. Sprites are reloaded for the controlled character if name is omitted.
Version Checkmark True.png resetragdoll [character name] Resets the ragdoll of the specified character. Sprites are reloaded for the controlled character if name is omitted.
Version Checkmark False.png setfreecamspeed [speed] Set the camera movement speed when not controlling a character. Defaults to 1.
Version Checkmark False.png showperf Toggles visibility of the Performance Statistics HUD
Version Checkmark False.png showseed Outputs the current level's seed to the console.
Version Checkmark True.png spawnsub [submarine name] Spawns a submarine at the location of the cursor.
Version Checkmark False.png starttraitormissionimmediately Skip the initial delay of the traitor mission and start one immediately.
Version Checkmark True.png toggleaitargets Toggles the visiblity of AI targets. Client-side only.
Version Checkmark False.png toggleitemhighlights Toggles the item highlight effect on/off. Client-side only.
Version Checkmark False.png toggleupperhud Toggles the visibility of the upper HUD elements. Client-side only. (Use "hud" to hide it entirely.)
Version Checkmark True.png triggerevent [id] Trigger a random event.
Version Checkmark False.png updatetextfile [sourcefile.txt/.xml] [destinationfile.txt/.xml] Inserts absent xml elements from the source file into the destination file. Useful for updating outdated translation files.
Version Checkmark False.png verboselogging Toggles verbose logging in the console on/off. When active, additional debug info is written to the console alongside standard info.

Permissions

Permissions are sets of rights to administrate a server. They are used to create ranks or can be attributed individually.

Permission Description
ManageRound Can start/end rounds.
Kick Can kick other players.
Ban Can ban other players.
Unban Can remove bans from other players.
SelectSub Can choose the submarine.
SelectMode Can choose the game mode.
ManageCampaign Can select the destination, mission and purchase supplies from the Campaign store.
ConsoleCommands Can use console commands - note that you also need to give permissions for individual console commands.
ServerLog Can read server logs.
ManageSettings Can change server settings.
ManagePermissions Can change the permissions of other clients.
KarmaImmunity Is made immune to the karma system's negative effects, doesn't lose karma.
All Grants all permissions.

Gallery

The console showing ping info on startup