Console Commands

From Official Barotrauma Wiki
Revision as of 18:27, 13 March 2022 by Blue (talk | contribs)
Jump to: navigation, search
Data is potentially outdated
Last updated for version 0.16.7.0
Last mentioned in changelog 1.0.13.0
The current game version is 1.2.8.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
    • Note that some commands don't require enabling cheats (and disabling achievements); notably, commands in the moderation, submarine editor, and misc categories 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 campaigndestination [index] Set the target location in the current campaign.
campaigninfo Display info about the current campaign, such as current money, location and available destinations.
setlocationreputation [value] Set your reputation to the current location to the specified value.
togglecampaignteleport Toggles the ability to teleport to a location on the campaign map by double-clicking. Works only in singleplayer.
pause Pauses the game. Only works in singleplayer.
Moderation ban [character name] Bans the selected character from the server.
banendpoint [IP Address/SteamID] Bans the selected IP Address/SteamID from the server.
banid [clientID] Bans the selected clientID from the server.
bindkey [key] [command] Binds a key to a command.
clientlist Outputs the character name, clientID and ping of all players in the server to the console.
givecommandperm [clientID/SteamID/character name/IP Address] Gives the selected player the permission to use the console commands typed in the next entry.
giveperm [clientID/SteamID/character name/IP Address] Gives the selected player the permission typed in the next entry.
giverank [clientID/SteamID/character name/IP Address] Gives the selected player the rank typed in the next entry.
kick [character name] Kicks the selected character from the server.
kickid [clientID] Kicks the selected clientID from the server.
killdisconnectedtimer [seconds] Set the delay until disconnected players are killed.
msg [message] Send a chat message with no sender specified.
mute [character name] Blocks a character from speaking through voice chat.
resetkarma [clientID] Resets the karma of a client to 100.
revokecommandperm [clientID/SteamID/character name/IP Address] Revokes the selected player's permission to use the console commands typed in the next entry.
revokeperm [clientID/SteamID/character name/IP Address] Revokes the selected player's permission typed in the next entry.
savebinds Writes current keybinds into the config file (= keybinds set using the keybind command).
say [message] Send a global chat message. When issued through the server command line, displays "HOST" as the sender.
setkarma [clientID] [0-100] Sets the karma of a client to the specified value.
showkarma Outputs the karma of all players to the console.
showperm [clientID/SteamID/character name/IP Address] Outputs the permissions of the selected player to the console.
togglecharacternames Toggle visibility of names above players. Client-side only.
togglekarma Toggles the karma system on/off.
togglekarmatestmode Toggles the karma test mode on/off. When on, notifies players of a karma change and its reason, also disables karma bans.
unban [character name] Unbans the selected character from the server.
unbanip [IP Address] Unbans the selected IP Address from the server.
unbindkey [key] Unbinds a command previously bound using bindkey.
unmute [character name] Allows a character to speak through voice chat.
Server
Settings
autorestart [true/false] Enables/disables the round autorestart timer.
autorestartinterval [seconds] Sets the delay between rounds, if autorestart is enabled. Setting this to 0 disables autorestart.
autorestarttimer [seconds] Sets the current autorestart timer to the specified value.
botcount [0-16] Sets the amount of bots on the ship to the specified value.
botspawnmode [fill/normal] Set how bots are spawned on the ship.
difficulty [0-100] Sets the difficulty value of the server to the specified value.
startwhenclientsready [true/false] Enables/disables autorestart when all players are ready.
Cheats ballastflora infect Infects random pump (priority those tagged "ballast") with Ballast Flora
ballastflora growthwarp [number] Increases growth speed of Ballast Flora
control [charactername] Start controlling the specified character (client-only).
enablecheats Enables cheat commands and disables achievements for the game session.
explosion [range] [force] [damage] [structural damage] [item damage] [emp strength] Creates an explosion at the position of the cursor.
fire Creates fire at the position of the cursor.
fixwalls/fixhulls Fixes all walls on the ship.
fixitems Restores all items to max condition.
freecam Switches the game into spectator mode.
giveaffliction [affliction] [affliction strength] [character name] Applies an Affliction to the specified character. Affliction is applied to the controlled character if name is omitted.
giveexperience [amount] [character name] Gives experience to the specified character. Experience is given to the controlled character if name is omitted.
givetalent [talent] [character name] Grants a Talent to the specified character. Talent is granted to the controlled character if name is omitted.
godmode [character name] Makes the character invulnerable to damage. Controlled character is selected if name is omitted.
godmode_mainsub Makes the submarine invulnerable to damage.
growthdelay Sets how long it takes for planters to attempt to advance a plant's growth.
heal [character name] Restores the specified character to max health. Controlled character is healed if name is omitted.
kill [character] Immediately kills the specified character. Controlled character is killed if name is omitted.
killmonsters Immediately kills all AI-controlled enemies in the level.
lighting Toggles lighting on/off. Client-side only.
los Toggle line-of-sight occlusion on/off. Client-side only.
money [integer value] Adds the specified amount to the current balance in Marks
oxygen/air Replenishes every room's oxygen levels to 100%
power Immediately powers up all nuclear reactors.
respawnnow Trigger a respawn if there are clients waiting to respawn.
revive [character name] Brings the specified character back from the dead. Controlled character is revived if name is omitted.
setclientcharacter [client name] [character name] Give control of the specified character to the specified client.
setskill [all/indentifier] [max/level] [character name] Set specified skills of a specified client to a specified level.
spawn [creaturename/jobname] [near/inside/outside/cursor] Spawn a creature or AI-controlled crewmember at the specified location.
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.
teleportcharacter [character name] Teleports the specified character to the cursor's position.
teleportsub [start/end/cursor] Teleports the sub to a given location. Warning: Very glitchy.
upgradeitem [upgrade] [level] [items] Adds an upgrade to the targeted item.
water Toggles water editing. Add water to a room by holding left click, and drain water by holding right click.
Submarine
Editor
alpha [0-255] Set the alpha (transparency) of the selected items/structures.
color [0-255] [0-255] [0-255] Set the RGB values of the selected items/structures.
load [submarine name] Loads a submarine.
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
reloadsprite Reloads the sprites of the selected items/structures. Also works in-game on the controlled character.
resetall Resets all items/structures to prefab defaults.
resetentitiesbyidentifier [identifier] Resets all items/structures with the given identifier to prefab defaults.
resetselected Resets the properties of the selected items/structures to prefab default.
save [submarine name] Saves the currently loaded submarine to ..\Barotrauma\Submarines\[submarine name]. Also works in singleplayer.
setentityproperties [property name] [value] Set the specified property of the selected items/structures to the specified value.
togglegrid Toggle visual snap grid in sub editor.
Misc quickstart [submarine name] [difficulty] [level seed] Starts a singleplayer sandbox (can only be executed from the main menu)
wikiimage_character Save an image of the currently controlled character with a transparent background.
wikiimage_sub Save an image of the main submarine with a transparent background.
Debug
Network
netstats Toggle visibility of the Network Statistics UI.
simulatedduplicateschance [0.00-1.00] Simulates packet duplication in network messages. A value of 1 means 100% of packets are duplicated.
simulatedlatency [min. latency (seconds)] [rand. latency (seconds)] Applies a simulated latency to network messages. Useful for testing real network conditions.
simulatedloss [0.00-1.00] Simulates packet loss in network messages. A value of 1 means 100% of packets are lost.
steamnetdebug Toggles Steamworks network debug logging.
Debug
In-game
autoitemplacerdebug Toggles automatic item placer debug info on/off. Auto-placed items are outputted to the console at round start.
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.
checkcrafting Checks item crafting and deconstruction recipes for inconsistencies.
debugai Toggles AI debug mode on/off. Only works in singleplayer.
debugdraw Toggles the debug drawing mode on/off. Client-side only.
disablecrewai Disables the AI of AI-controlled crewmembers.
disableenemyai Disables the AI of AI-controlled enemies.
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.
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.
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.
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.
editcharacters Opens the Character Editor.
editevents Opens the Event Editor.
editlevels Opens the Level Editor
editparticles Opens the Particle Editor.
editsprites Opens the Sprite Editor.
editsubs/subeditor Opens the Submarine Editor.
enablecrewai Enables the AI of AI-controlled crewmembers.
enableenemyai Enables the AI of AI-controlled enemies.
eventmanager Toggles the master event manager on/off. Random events cannot happen if this is turned off.
findentityids [entity name] Outputs the entityID of the specified entity to the console.
fpscounter Toggles the in-game FPS counter on/off.
game Switch to the in-game view.
gender [Male/Female/None] Switches the gender of the controlled character to the specified value.
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.
hud/togglehud Toggles the visibility of all the HUD elements. Client-side only.
hudlayoutdebugdraw Toggles the debug drawing mode of HUD layout areas on/off.
interactdebugdraw Toggles the debug drawing mode of item interaction ranges on/off.
itemlist/items Outputs all item prefabs available for spawning.
jointscale [value] [character name] Define the joint scaling for the specified character. Joint scaling is changed for the controlled character if name is omitted.
limbscale [value] [character name] Define the limb scaling for the specified character. Limb scaling is changed for the controlled character if name is omitted.
listtasks Outputs all asynchronous tasks currently in the task pool to the console.
loadtexts [sourcefile.txt] [destinationfile.xml] Loads all lines of text from a .txt file to a .xml file sequentially.
loadwearable [id] Force-select a certain job loadout variant for the controlled character.
lock Locks movement of the main submarine.
lockx Locks movement of the main submarine in the X (left-right) direction.
locky Locks movement of the main submarine in the Y (up-down) direction.
mainmenu/menu Switch to the main menu.
messagebox [header] [message] [default/in-game] Create a message box. Client-side only.
race [White, Black, Asian, None] Sets the race of the controlled character to the specified value.
ragdoll [character name] Ragdolls the specified character. Ragdolls controlled character if name is omitted.
ragdollscale [character name] Define the ragdoll scaling for the specified character. Ragdoll scaling is changed for the controlled character if name is omitted.
recreateragdoll [character name] Recreate the ragdoll for the specified character. Ragdoll is recreated for the controlled character if name is omitted.
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.
resetragdoll [character name] Resets the ragdoll of the specified character. Sprites are reloaded for the controlled character if name is omitted.
setfreecamspeed [speed] Set the camera movement speed when not controlling a character. Defaults to 1.
showperf Toggles visibility of the Performance Statistics HUD
showseed Outputs the current level's seed to the console.
spawnsub [submarine name] Spawns a submarine at the location of the cursor.
starttraitormissionimmediately Skip the initial delay of the traitor mission and start one immediately.
toggleaitargets Toggles the visiblity of AI targets. Client-side only.
toggleitemhighlights Toggles the item highlight effect on/off. Client-side only.
toggleupperhud Toggles the visibility of the upper HUD elements. Client-side only. (Use "hud" to hide it entirely.)
triggerevent [id] Trigger a random event.
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.
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 Allows players to start and end rounds.
Kick Allows players to kick other players.
Ban Allows players to ban other players.
Unban Allows players to unban other players.
SelectSub Allows players to select the sub when the selection mode is on "Manual".
SelectMode Allows players to select the gamemode.
ManageCampaign Same as giving ManageMoney, SellInventoryItems, SellSubItems, ManageMap, and ManageHires permissions.
ConsoleCommands Allows players to use Console Commands. Permissions for individual console commands are also required.
ServerLog Allows players to read the server logs.
ManageSettings Allows players to change the server's settings.
ManagePermissions Allows players to change the permissions of other clients. Plays can only grant permissions that they already have.
KarmaImmunity Immunizes players against the effects of Karma.
ManageMoney Allows players to take money from the bank without needing a vote, set salaries, and take money from other player's wallets.
SellInventoryItems Allows players to sell items to shops from their inventories.
SellSubItems Allows players to sell items to shops directly from the submarine.
ManageMap Allows players to select missions and destinations on the campaign map.
ManageHires Allows players to hire and fire NPC crewmates.
ManageBotTalents Allows players to select talents for NPC crewmates.
All Grants players all permissions.

Gallery

The console showing ping info on startup