Console variables (or ConVars) are used by games running on Source engine such as Garry's Mod to configure various options. As the name implies, ConVars are often viewed or changed from the console. However, in most cases, changes made via the console will only be temporary and will reset when the server restarts or the map changes.
This page will provide a list of server ConVars that can be used to configure Custom Roles for TTT, as well as instructions on setting up your server so that your ConVars won't be automatically reset.
A list of ConVars from base Trouble in Terrorist Town can be found on their website's Server Settings page.
This tutorial will not explain how to create a Garry's Mod server from scratch, only how to configure them for Custom Roles for TTT.
As ConVars reset every time the server restarts or the map changes, it is important to create a config file that will automatically update ConVars to the desired value any time this happens.
There are two types of Garry's Mod servers and they each need to be configured through different files. The process is otherwise identical but make sure you know which type of server you are running and have the correct file path before continuing.
If you are starting a multiplayer game from within the Garry's Mod client then you are running a listen server. The config file for listen servers is located within your Garry's Mod game files. In Steam, right click on Garry's Mod and select 'Manage', then 'Browse local files'. An explorer window should open to the folder containing your Garry's Mod game files. Open 'garrysmod', then 'cfg'. Inside this folder is a file named 'listenserver.cfg' which is the config file you should use for the rest of the tutorial.
If you are running your server separately from your Garry's Mod client, either through another process or a server hosting platform, you are running a dedicated server. The config file for dedicated servers is located inside the server folders. Open the folder containing your server and open 'garrysmod', then 'cfg'. Inside this folder is a file named 'server.cfg' which is the config file you should use for the rest of the tutorial.
Once you have located your config file, open it using a plain text editor such as Notepad. You can add ConVars to this file such that each line contains a single ConVar followed by one or more spaces and then the value you want to set that ConVar to. Comments can be added to the file by typing '//'. Anything after those slashes on the same line will be ignored when the file is loaded by the server. This allows you to write notes and reminders to help organise your config file. Blank lines will also be ignored by the server allowing you to organise ConVars into groups.
ConVars can come in four different types. Depending on the type you may need to format the ConVar value in a specific way:
ttt_example_integer_convar 15
will set the value of the ConVar ttt_example_integer_convar
to 15.)ttt_example_float_convar 0.33
will set the value of the ConVar ttt_example_float_convar
to 0.33.)ttt_example_boolean_convar 0
will set the value of the ConVar ttt_example_boolean_convar
to false.)ttt_example_string_convar "test"
will set the value of the ConVar ttt_example_string_convar
to "test".)Below is an example of what a functional config file could look like:
ttt_example_convar 1 // This text will be ignored because it comes after two slashes
ttt_another_example 0.5 // This line will set the value of the ConVar 'ttt_another_example' to 0.5
ttt_yet_another_example 10 // You can have as many spaces as you want between the ConVar and its value
// Comments can take up full lines and lines can even be left blank
// ConVars can use whole numbers (integers), decimals (floats), true/false (booleans), or text (strings) as their values
ttt_boolean_convar 0 // If a ConVar requires true or false (otherwise known as a 'boolean') as its value, use 0 for false and 1 for true
ttt_another_boolean 1 // This line would set the value of the ConVar 'ttt_another_boolean' to true
ttt_string_convar "hello" // If a ConVar requires text (otherwise known as a 'string') as its value, put the text inside quotation marks
ttt_another_string "custom roles for ttt" // This line would set the value of the ConVar 'ttt_another_string' to "custom roles for ttt"
A full list of Custom Roles for TTT ConVars and their default values in a config file ready format can be found on the Custom Roles for TTT GitHub repository.
Custom Roles for TTT has over 800 ConVars that can be used to customise your server. Most of these ConVars are unique to each role and won't be listed here, but you can find them in the expandable sections for each role on their respective team's page.
Some ConVars are automatically generated for each role and have been grouped here to save space. For each of these ConVars replace the '*' with the name of the role you want to configure in lower case and without spaces.
ConVar | Default | Type | Description |
---|---|---|---|
ttt_*_enabled | 0 | Boolean | Whether this role is able to spawn at the start of the round. (The regular Innocent, Traitor, and Detective roles are always enabled.) |
ttt_*_spawn_weight | 1 | Integer | The weight assigned to spawning this role compared to other roles on the same team. (e.g. A role with a weight of 2 will be twice as likely to spawn as a role with a weight of 1 on the same team. The regular Innocent, Traitor, and Detective roles cannot have weights assigned.) |
ttt_*_min_players | 0 | Integer | The minimum number of players required to spawn this role. (The regular Innocent, Traitor, and Detective roles cannot have minimum player requirements.) |
ttt_*_starting_health | 100 (Killer: 150, Loot Goblin: 50, Old Man: 1, Sponge: 150) | Integer | The amount of health this role spawns with. (The Killer, Loot Goblin, Old Man, and Sponge have different default values. Set to 0 or -1 to use the game's default starting health.) |
ttt_*_max_health | 100 (Killer: 150, Loot Goblin: 50, Old Man: 1, Sponge: 150) | Integer | The maximum amount of health this role can have. (The Killer, Loot Goblin, Old Man, and Sponge have different default values. Set to 0 or -1 to use the game's default maximum health.) |
ttt_*_name | Blank | String | The name you would like this role to be called. (Automatically attempts to generate articles and plurals, but it is not always successful. Use ttt_*_name_plural and ttt_*_name_article to manually fix these if required.) |
ttt_*_name_plural | Blank | String | The plural form of the name you would like this role to be called. |
ttt_*_name_article | Blank | String | The article that comes before the name you would like this role to be called. (e.g. If the role was called 'innocent' the article would be 'an', and if the role was called 'traitor' the article would be 'a'.) |
Some roles can only spawn in groups and do not use the same role spawning system as other roles. In these cases the ttt_*_enabled
, the ttt_*_spawn_weight
, and the ttt_*_min_players
are not used to configure each role individually and the following ConVars are used instead. For each of these ConVars replace the '*' with the name of the group you want to configure in lower case and without spaces. (e.g. replace '*' with 'twins' to configure the Twins group containing the Evil Twin and the Good Twin.)
The following roles are grouped:
ConVar | Default | Type | Description |
---|---|---|---|
ttt_*_enabled | 0 | Boolean | Whether this group is able to spawn at the start of the round. |
ttt_*_spawn_chance | 0.1 | Float | The chance that this group will spawn in a round. (e.g. 0.1 = 10%.) |
ttt_*_min_players | 0 | Integer | The minimum number of players required to spawn this group. |
NOTE: Health and name ConVars can still be used to configure each role individually, even if those roles are part of a group.
Some ConVars are used to configure who has access to a shop, what items are available and how many credits they have. For each of these ConVars replace the '*' with the name of the role you want to configure in lower case and without spaces. These ConVars only apply to roles that are configured to have access to a shop.
ConVar | Default | Type | Description |
---|---|---|---|
ttt_shop_for_all | 0 | Boolean | Whether all roles should have a shop. (Roles that normally do not have a shop will need to have items added via the roleweapon system. Details on the roleweapon system can be found on the Role Weapon Shop tutorial page.) |
ttt_*_credits_starting | 0 (Doctor: 1, Killer: 2, Mercenary: 1, Quartermaster: 3, Other special detectives: 1, Special traitors: 1) | Integer | The number of credits this role should start with. (The Doctor, Killer, Mercenary, special detectives, and special traitors have different default values. The default Traitor and Detective use uniquely named ConVars that are from vanilla TTT.) |
ttt_shop_random_position | 0 | Boolean | Whether to randomize the position of the items in the shop. |
ttt_shop_random_percent | 50 | Integer | The percent chance that a weapon in the shop will be not be shown. (e.g. 50 = 50%.) |
ttt_*_shop_random_percent | 0 | Integer | The percent chance that a weapon in the shop will be not be shown for this role. (e.g. 50 = 50%. Set to 0 to use the value of ttt_shop_random_percent instead.) |
ttt_*_shop_random_enabled | 0 | Boolean | Whether role shop randomization is enabled for this role. |
ttt_*_shop_sync | 0 | Boolean | Whether this role should have access to all weapons that the regular role for their team has access to. (e.g. If the Hypnotist should have access to Traitor items, or if the Marshal should have access to Detective items. Only applies to special traitor and special detective roles.) |
ttt_*_shop_mode | 0 (Mercenary: 2) | Boolean | What additional items are available to the Hive Mind in the shop:
|
ConVar | Default | Type | Description |
---|---|---|---|
ttt_roundtime_win_draw | 0 | Boolean | Whether a round that ends because the round time limit has passed counts as a draw. If it is not a draw, the innocent team teams. |
ttt_debug_logkills | 1 | Boolean | Whether to log when a player is killed in the console. |
ttt_debug_logroles | 1 | Boolean | Whether to log what roles players are assigned in the console. |
ttt_sprint_enabled | 1 | Boolean | Whether sprinting is enabled. |
ttt_sprint_bonus_rel | 0.4 | Float | The relative speed bonus given while sprinting. (e.g. 0.4 = 40% speed increase.) |
ttt_sprint_regenerate_innocent | 0.08 | Float | Stamina regeneration speed for non-traitors while they are not sprinting. |
ttt_sprint_regenerate_traitor | 0.12 | Float | Stamina regeneration speed for traitors while they are not sprinting. |
ttt_sprint_consume | 0.2 | Float | Stamina consumption speed for all players while they are sprinting. |
ttt_bem_allow_change | Boolean | 1 | Whether to allow clients to change the look of the shop menu. |
ttt_bem_sv_cols | 4 | Integer | The number of columns in the shop menu's item list. |
ttt_bem_sv_rows | 5 | Integer | The number of rows in the shop menu's item list. |
ttt_bem_sv_size | 64 | Integer | The item size in the shop menu's item list. |
ttt_scoreboard_deaths | 0 | Boolean | Whether to show the deaths column on the scoreboard. (Server must be restarted for changes to take effect.) |
ttt_scoreboard_score | 0 | Boolean | Whether to show the score column on the scoreboard. (Server must be restarted for changes to take effect.) |
ttt_round_summary_tabs | "summary,hilite,events,scores" | String | The tabs to show in the round summary screen. (Changing the order of the values will change the order of the tabs. Excluding a value from the comma-delimited list will prevent that tab from showing. Invalid values will be ignored. Server or round must be restarted for changes to take effect.) |
ttt_death_notifier_enabled | 1 | Boolean | Whether the name and role of a player's Killer should be shown to the victim. |
ttt_death_notifier_show_role | 1 | Boolean | Whether to show the killer's role in death notification messages. |
ttt_death_notifier_show_team | 0 | Boolean | Whether to show the killer's team in death notification messages. (Only used when ttt_death_notifier_show_role is disabled.) |
ttt_smokegrenade_extinguish | 1 | Boolean | Whether smoke grenades should extinguish fire. |
ttt_player_set_color | 1 | Boolean | Whether player colors are set each time that player spawns. |
ttt_dna_scan_detectives_loadout | 0 | Boolean | Whether all detectives should be given a DNA scanner. If disabled, only the Detective role will get one. |
ttt_dna_scan_on_dialog | 1 | Boolean | Whether to show a button to open the DNA scanner on the body search dialog. |
ttt_dna_scan_only_drop_on_death | 0 | Boolean | Whether the DNA scanner should only be droppable when the holder dies. |
ttt_spectator_corpse_search | 1 | Boolean | Whether spectators can search bodies (not shared with other players). |
ttt_corpse_search_not_shared | 0 | Boolean | Whether corpse searches are not shared with other players (only affects non-detective-like searchers). |
ttt_corpse_search_killer_team_text_independent | 0 | Boolean | Whether corpse searches should include flavor text hinting at the team of their independent killer. |
ttt_corpse_search_killer_team_text_innocent | 0 | Boolean | Whether corpse searches should include flavor text hinting at the team of their innocent team killer. |
ttt_corpse_search_killer_team_text_jester | 0 | Boolean | Whether corpse searches should include flavor text hinting at the team of their jester team killer. |
ttt_corpse_search_killer_team_text_monster | 0 | Boolean | Whether corpse searches should include flavor text hinting at the team of their monster team killer. |
ttt_corpse_search_killer_team_text_traitor | 0 | Boolean | Whether corpse searches should include flavor text hinting at the team of their traitor team killer. |
ttt_corpse_search_killer_team_text_plain | 0 | Boolean | Whether corpse searches should include plain text showing the team of their killer. (Requires one of the ttt_corpse_search_killer_team_text_* team convars to be enabled.) |
ttt_corpse_search_team_text_independent | 0 | Boolean | Whether corpse searches of independents should include flavor text hinting at the team of their killer. |
ttt_corpse_search_team_text_innocent | 0 | Boolean | Whether corpse searches of innocents should include flavor text hinting at the team of their killer. |
ttt_corpse_search_team_text_jester | 0 | Boolean | Whether corpse searches of jesters should include flavor text hinting at the team of their killer. |
ttt_corpse_search_team_text_monster | 0 | Boolean | Whether corpse searches of monsters should include flavor text hinting at the team of their killer. |
ttt_corpse_search_team_text_traitor | 0 | Boolean | Whether corpse searches of traitors should include flavor text hinting at the team of their killer. |
ttt_color_mode_override | none | String | Forces all players to have a certain role color setting. none (let user decide), default, simple, protan, deutan, tritan |
ttt_spectators_see_roles | 0 | Boolean | Whether spectators (not dead players) should be able to see the roles of all players |