Difference between revisions of "Talk:List of Team Fortress 2 console commands and variables/en"

From Valve Developer Community
Jump to: navigation, search
(Replaced content with "{{delete}}")
(Tag: Replaced)
 
Line 1: Line 1:
= Updating the ccmd/cvar list (updated) =
+
{{delete}}
=== Generating the dump ===
 
# Download the latest versions of [https://www.metamodsource.net/downloads.php?branch=stable Metamod:Source] and [https://www.sourcemod.net/downloads.php?branch=stable SourceMod] for your operating system.
 
# Extract both archives into the client gamedir (e.g. <code>C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf</code>). There show now be an <code>addons</code> folder with both plugins inside.
 
# Navigate to <code>addons/sourcemod/plugins</code> and move all existing <code>.smx</code> files to the <code>disabled</code> folder (we don't want them running during the dump).
 
# Download the ccmd dump plugin I've written [https://github.com/osyu/vdcccmddump/raw/master/plugins/vdcccmddump.smx here] (or compile from [https://github.com/osyu/vdcccmddump/blob/master/scripting/vdcccmddump.sp source]) and place it in the same <code>plugins</code> folder. It should be the only plugin that's not disabled.
 
# Disable any other Source plugins you might have installed, like P-REC, for now (the dump plugin ignores P-REC's ccmds anyway but let's stay on the safe side).
 
# Add <code>-insecure</code> to your launch options (to allow unsigned plugins to run on client). Learn how to set Steam game launch options [https://help.steampowered.com/en/faqs/view/7D01-D2DD-D75E-2955 here].
 
# Open the game and start a listen server on any map (e.g. <code>map itemtest</code>).
 
# Ensure that the dump plugin is the only one loaded by running <code>sm plugins list</code>.
 
# Run <code>sm_dump_ccmds</code> in console. It should dump to a text file in <code>addons/sourcemod/data</code>. Move this file somewhere safe.
 
# To revert everything and make your game playable again, after closing it remove the <code>-insecure</code> launch option and delete the <code>addons</code> and <code>cfg/sourcemod</code> folders from the gamedir.
 
 
 
=== Updating the article ===
 
The dump text file contains a wikitext-formatted table that can be pasted onto this wiki, as well as an HTML comment with the build number and total ccmds. Follow these steps before saving changes to the article.
 
# Preview the table on the wiki and scroll through to find any incorrect min or max values (as a result of floating-point imprecision). You can also use the "Show changes" button to find incorrect changes in the table more easily.
 
#* The two main ones you'll always have to fix are:
 
#*: <code>mat_viewportscale</code>'s min value, which displays as <code>0.001563</code> but is really <code>0.0015625</code> (1 ÷ 640) and
 
#*: <code>viewmodel_fov</code>'s max value, which displays as <code>179.899994</code> but is really <code>179.9</code>.
 
# Update the retrieval date, build number and total ccmds using the HTML comment, and then delete that comment as it's otherwise unneeded.
 
 
 
=== Caveats ===
 
* Most commands and variables related to OpenGL are only available when the game is using OpenGL, so the plugin misses those when using DirectX.
 
[[User:Osyu|Osyu]] ([[User talk:Osyu|talk]]) 15:01, 31 August 2021 (PDT)
 
 
 
= How to update the cvar/cmd list =
 
'''IMPORTANT: If you have done this before, delete your previous version of cvarlist.txt or you will have quite a bit of confusion on your hands.'''
 
 
 
These instructions are written for a computer running Windows and involve using the console for Team Fortress 2 (TF2). Information on using the console can be found at [https://wiki.teamfortress.com/wiki/Console the TF2 wiki's page on the console]. Before starting to update the cvar/cmd list, it is a good idea to save your current settings for TF2 since updating the cvar/cmd list requires resting your game's settings. If you use a config or have an autoexec you should be okay, but it is still a good idea to create a copy of your current settings before beginning. To create a copy of your current settings enter
 
<pre>host_writeconfig</pre>
 
into the console. The command saves all of your current settings to the file '''config.cfg'''. When you are done updating the cvar/cmd list and want to return to your normal settings again execute the config by entering
 
<pre>exec config</pre>
 
into the console.
 
 
 
The first step to updating the cvar/cmd list is to open up your preferred text editor, such as Notepad, and then copy [https://pastebin.com/raw/eZQ1sT1P this code] into a new text document. Next, save the document as '''defaults.cfg''' into your '''\cfg\''' folder for TF2, usually found at '''C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf\cfg''', while making sure to set the file type to save the file as to '''All files (*.*)'''. This code resets a lot of commonly changed variables back to their default values. It is needed to so that your update to the cvar/cmd will accurately represent every variable and its default value.
 
 
 
To check that the config correctly restores the defaults to all the variables it is supposed to enter
 
<pre>exec defaults</pre>
 
into the console. After you do so, TF2 should become unresponsive and freeze for a bit. After it finishes loading, you should be prompted with a dialog saying '''READY TO PLAY?''', click the (X) in the top right corner to close it. Once it has been closed, open up the options menu, and then click on the '''Advanced...''' box. A pop up should appear with a check box to enable the developer console. Select check the box, click OK, and then click OK again.  Open the console again and enter the following
 
<pre>exec defaults</pre>
 
Wait again for TF2 to load and then enter
 
<pre>clear;differences</pre>
 
After that all you should see in the console is
 
<pre>
 
"hap_melee_scale" = "0.800000" ( def. "0.8" )
 
client
 
"hap_noclip_avatar_scale" = "0.100000" ( def. "0.10f" )
 
client
 
"cl_overdraw_test" = "0"
 
client cheat
 
"name" = "<Your Username>" ( def. "unnamed" )
 
archive server_can_execute
 
- Current user name
 
"mat_texture_list_all" = "0"
 
cheat
 
- If this is nonzero, then the texture list panel will show all currently-loaded textures.
 
"mat_texture_list_view" = "1"
 
cheat
 
- If this is nonzero, then the texture list panel will render thumbnails of currently-loaded textures.
 
"mat_show_texture_memory_usage" = "0"
 
cheat
 
- Display the texture memory usage on the HUD.
 
"r_worldlights" = "2" ( def. "4" )
 
- number of world lights to use per vertex
 
"r_flashlightdepthtexture" = "0" ( def. "1" )
 
"mat_texture_limit" = "-1"
 
- If this value is not -1, the material system will limit the amount of texture memory it uses in a frame. Useful for identifying performance cliffs. The value is in kilobytes.
 
</pre>
 
The list that your console should now be displaying is all of the variables that were not reset to their default values. If you see more variables then the ones I listed, please leave a message on [[User talk:The Editors Apprentice|my talk page]] so that I can update the link for the information to put into '''defaults.cfg''' so that all variables are reset. Regardless, seeing something different isn't a problem. What variables are left in the console is important for future steps, so make a copy of the console's contents somewhere for future retrieval.
 
 
 
The next steps involve actually collect the new cvar/cmd list. Start by entering
 
<pre>clear;con_logfile cvarlist.txt;cvarlist</pre>
 
and then
 
<pre>con_logfile end</pre>
 
into the console. What this does is clears the console of any previous text, starts logging all console outputs to '''cvarlist.txt''', outputs the cvarlist to the console, and then ends the recording to the '''cvarlist.txt''' file. Once you have run the command locate your '''\tf\''' folder, usually found at '''C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\'''.
 
Inside it there should be a text file by the name '''cvarlist.txt''', it should now contain a list of all TF2's commands and console variables. The list of variables which were not reset to their default values are now needed. Inside '''cvarlist.txt''' find each of the variables that had its default value listed next to it in the form '''"<Variable Name>" = "*" ( def. "#" )''', and change whatever is listed as its value to the value listed inside parentheses, the # in example given.
 
 
 
Now that you have a correct and complete cvar/cmd list, the next step is to update the page [[List of TF2 console commands and variables]]. Start by adding the date that you are doing this work on to the note at the top, as well as the build number of TF2 that you are running. To find out what build of TF2 you are running type
 
<pre>clear;map itemtest</pre>
 
into the console. The commands clear out the console and then load up the Itemtest map. Once Itemtest has loaded feel free to disconnect. In the console there should be something that looks like this
 
<pre>
 
Team Fortress
 
Map: itemtest
 
Players: 1 / 24
 
Build: *******
 
Server Number: 1
 
</pre>
 
copy down the number that is in the place of the asterisks (*) and use it to replace the build number previously listed at [[List of TF2 console commands and variables]]. As a side note, the Itemtest map isn't special, you can load up any map, but it in particular is easy to use.
 
 
 
Next, copy and paste corresponding sections of the cvarlist to the appropriate locations in alphabetical order, a helpful template for this can be found [https://pastebin.com/raw/LrUGu6AA here]. Finally, update the total number of commands and variables in the list using the number listed in a note at the end of the '''cvarlist.txt''' file.
 
 
 
If you have any questions feel free to contact me on talk page! [[User:The Editors Apprentice|The Editors Apprentice]] ([[User talk:The Editors Apprentice|talk]]) 17:15, 29 April 2020 (UTC)
 
 
 
== norecord tags use ==
 
 
 
Knowing how ConVar flags work in-code, I'm assuming `norecord` is tied to the `FCVAR_NORECORD` flag, which forbids the ConVar/ConCommand from being recorded in demos.
 
 
 
I'd put that in the page itself, but I want to know you guys' opinion before I do so.
 
 
 
Thanks! [[User:Lonkfania|Lonkfania]] ([[User talk:Lonkfania|talk]]) 15:28, 7 August 2017 (UTC)
 
 
 
 
 
That sounds great! Adding it would be much appreciated! [[User:The Editors Apprentice|The Editors Apprentice]] ([[User talk:The Editors Apprentice|talk]]) 18:56, 21 October 2017 (UTC)
 
 
 
== About Text Styling ==
 
 
 
Can the text color used for 'devonly' Concommands / Convars be altered? It looks too <span style="color:#5a5151;">dark</span> and blends into the background of the <span style="color:#515151;">table</span>. I suggest just keeping the text the same as 'hidden' commands, just that they have italics, would be appreciated! -- [[User:Orinuse|Orin]] ([[User talk:Orinuse|talk]]) 10:11, 11 October 2021 (PDT)
 

Latest revision as of 09:03, 7 July 2023

Warning icon.png
This discussion page has been marked as a candidate for speedy deletion.
If you object to this decision, then please discuss why hereIf this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators - Remember to check if anything links here and the page history (last edit) before deleting.