Adding Convars to the Multiplayer Advanced Tab: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (updated language bar.)
(Replaced content with "{{MultiPage}} Category:Tutorials Category:Modding")
Tag: Replaced
Line 1: Line 1:
{{lang|Adding Convars to the Multiplayer Advanced Tab}}
{{MultiPage}}
This page discusses how to add your own [[convar]]s to the 'Advanced' section in the Multiplayer tab of the Options menu.
 
By default there should be nothing in this tab for your mod. To add convars to it create a <code>user_default.scr</code> file and place it in the <code>cfg</code> folder inside your mod folder.
'''Or just edit the "settings.scr", also in the cfg folder. That file comes with the mod'''
 
Add the following inside it:
 
<pre>
// NOTE:  THIS FILE IS AUTOMATICALLY REGENERATED,
//DO NOT EDIT THIS HEADER, YOUR COMMENTS WILL BE LOST IF YOU DO
// User options script
//
// Format:
//  Version [float]
//  Options description followed by
//  Options defaults
//
// Option description syntax:
//
//  "cvar" { "Prompt" { type [ type info ] } { default } }
//
//  type =
//  BOOL  (a yes/no toggle)
//  STRING
//  NUMBER
//  LIST
//
// type info:
// BOOL                no type info
// NUMBER      min max range, use -1 -1 for no limits
// STRING      no type info
// LIST          delimited list of options value pairs
//
//
// default depends on type
// BOOL is "0" or "1"
// NUMBER is "value"
// STRING is "value"
// LIST is "index", where index "0" is the first element of the list
 
 
// Half-Life User Info Configuration Layout Script (stores last settings chosen, too)
// File generated:  Tue May 26 04:33:22 AM
//
//
// Cvar - Setting
 
VERSION 1.0
 
DESCRIPTION INFO_OPTIONS
{
"r_drawviewmodel" //the convar
{
"Draw the viewmodel"  //the description
{ BOOL }  //the type of convar
{ "1" }  //the boolean value
}
"viewmodel_fov"  //the convar
{
"Adjust the field of view"  //the description
{ SLIDER 54 70 }  //the type of convar
{ "1" }  //the boolean value
}
}
</pre>
 
There's 2 example convars in there. One is a 'slider' and one a [[boolean]]. It's self explanatory how to add your own.
 
[[Category:Tutorials]] [[Category:Modding]]
[[Category:Tutorials]] [[Category:Modding]]

Revision as of 09:25, 15 May 2023

Note.pngNote:Archived page history
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.