Counter-Strike 2

Counter-Strike 2

Sem avaliações suficientes
[EN] All about creating a config for CS2
Por ⱠƗЎ27 ☆ 🆁🆄N3M0Y
With this guide, you will learn how to create your own configs for CS2 from scratch.
   
Premiar
Adic. a Favoritos
Nos Favoritos
Desfavoritar
Introduction
This manual was written with the help of a translator. I apologize in advance for inaccuracies in translation.

Writing a config for CS is somewhat similar to writing code in programming. Sometimes it's very easy to solve the problem, and often you have to look for workarounds. This is very interesting, so I decided to write this guide so that everyone could try to do something with their own hands, be in the role of a programmer, make their own changes to the game.

Before starting this guide, I would like to say that everything that is published here is both personal experience and materials taken from open access. I express my great gratitude to those who are trying for the good of the game and wish it to become only better and more convenient for each player. If you like the guide, then do not forget to rate it, so I will understand that I have done something useful for the entire CS2 community.
Required programs
In order to start writing the config, we need to use the .cfg file editor. You can use a notepad, but I think it's not so convenient, so I'll recommend what I use.

Notepads App
A simple and intuitive interface, has all the functions necessary for us, there is no advertising, and it just looks stylish. You can download it for free from the Microsoft App Store or from the official website.
Before you start
This guide will contain illustrative examples with explanations. Explanations are written behind the signs "//", you can also put such explanations in your config to better navigate it.

Example:
command //explanation
Or:
command //explanation
Basic commands and variables
There is a slight difference between commands and variables. To explain it in simple terms:
Command - a specific action that needs to be performed by the config.
Variable is an abstract storage location paired with an associated symbolic name that contains some amount of information called a value;
A constant variable is a variable that does not change.

Be sure to pay attention to the fact that in the config, commands and variables are placed in different places. Do not confuse them with each other!

Commands
BIND
A command that assigns a command or series of commands to a specific key.
bind "G" "drop;" //assigns the “throw item” command to the “g” key
You can also assign not just one command to a key, but a series of commands. This is done by separating commands with the symbol ";".
bind "F10" "say goodbye;quit" //assigns the commands “say goodbye to the chat” and “exit the game” to the “F10” key
BINDTOGGLE
A command operating on the principle of a binary switch.
Has a value of "1" - enabled and a value of "0" - disabled.
togglebind "N" "noclip" //allows you to toggle the value of the "noclip" command between 0 and 1 using the "N" key
ALIAS
A command that allows you to create your own variables.
alias "variable name" "command" //the name of the variable can be anything, the main thing is that it does not conflict with the main CS2 commands
Aliases can be of different types:
Simple alias
Somewhat similar to a simple bind, but the command is assigned not to a key, but to a variable.
alias "a1" "buy awp" //assigns the command "buy awp" to the variable "a1"
An alias that combines several aliases
alias "a1" "buy awp" //assigns the command "buy awp" to the variable "a1" alias "a2" "buy deagle" //assigns the command "buy deagle" to the variable "a2" alias "a12" "a1;a2;" //assigns the variables "a1" and "a2" to the variable "a12"
Aliases can be used as switches:
Simple switch //something like bindtoggle
alias "nclp" "nc1" //assigns the variable "nc1" to the variable "nclp" alias "nc1" "noclip 1;alias nclp nc0" //assigns the command "noclip 1" to the variable "nclp" and then switches to the variable "nc0" alias "nc0" "noclip 0;alias nclp nc1" //assigns the command "noclip 0" to the variable "nclp" and then switches to the variable "nc1"
Complicated switch
alias "sw_crosshaircolor" "cr_col1" alias "cr_col1" "cl_crosshaircolor 5;cl_crosshaircolor_r 0;cl_crosshaircolor_g 255;cl_crosshaircolor_b 0;alias sw_crosshaircolor cr_col2" // green(1) color, switch to 2nd color alias "cr_col2" "cl_crosshaircolor 5;cl_crosshaircolor_r 255;cl_crosshaircolor_g 0;cl_crosshaircolor_b 0;alias sw_crosshaircolor cr_col3" // red(2) color, switch to 3rd color alias "cr_col3" "cl_crosshaircolor 5;cl_crosshaircolor_r 0;cl_crosshaircolor_g 0;cl_crosshaircolor_b 255;alias sw_crosshaircolor cr_col1" // blue(3) color, switch to 1 color //if you bind to a certain key, then when you press the key, the color of the sight will alternately change to green, red, blue.
bind "w" "sw_crosshaircolor" //assigns the variable "sw_crosshaircolor" to the "w" key (the crosshair color changes when you press the "w" key)
Button (active when the key is held down)
alias "fire_red" "cl_crosshaircolor_r 255;cl_crosshaircolor_g 0;cl_crosshaircolor_b 0" //assigns the sight color "red" to the variable "fire_red" alias "fire_blue" "cl_crosshaircolor_r 0;cl_crosshaircolor_g 0;cl_crosshaircolor_b 255" //assigns the sight color "blue" to the variable "fire_blue" alias "+firercolor" "+attack;fire_red" //assigns the variable "fire_red" and the positive command "attack" to the positive variable "firercolor" alias "-firercolor" "-attack;fire_blue" //assigns the variable "fire_blue" and the negative command "attack" to the negative variable "firercolor" //positive commands are 1 (enabled), negative commands are 0 (disabled) //if you bind the shooting button, the sight will change its color when shooting.
bind "mouse1" "firecolor"
Constant variables
TOGGLE
A constant variable entered before the console command to assign sequential switching of entered values.
bind "V" "toggle volume 0.1 0.5 1.0" //assigns the variable "toggle" the game volume values "0.1" "0.5" "1.0" (these values will change one by one) and assigns them to the "V" key
INCREMENTVAR
A constant variable entered before the console command to assign sequential switching of values in a certain step from a specified minimum to a specified maximum.
bind "H" "incrementvar sensitivity 1.0 3.0 0.5" //assigns the variable "incrementvar" sensitivity values "1.0" "3.0" in steps of "0.5" (these values will change step by step from 1.0 to 3.0) and assigns to the "H" key
Commands that were used in the tutorial
drop
throw away item
say (text)
write to general chat
say_team (text)
write in team chat
buy (item)
buy selected item
cl_crosshaircolor (0-5)
change color
cl_crosshaircolor_r (0-255)
red intensity
cl_crosshaircolor_g (0-255)
green intensity
cl_crosshaircolor_b (0-255)
blue intensity
volume (0-1)
game volume
voice_enable (0-1)
voice chat volume
sensitivity (value)
mouse sensitivity
Setting up the config
Config structure
The structure of your config should be legible so that it can always be changed. To make it easier for you to navigate the config, I advise you to comment (sign) sections and lines using “//”, and also divide the binds into separate blocks.
Also, do not forget to combine binds and aliases related to them into blocks.
Output messages to the console
This item has a purely aesthetic effect. If you want your config to launch effectively, you can use the commands:
clear - clear the console
echo - write to the console
You can try to make an image out of the symbols, just remember that “echo” must be written at the beginning of each line that you want to output to the console.
What to add to the config
It all depends on the purpose of the config. Configs can be personal or shared.
Personal config
This is a config that only you use. In such a config you can immediately add game settings, screen resolution, sensors, sight, radar, hand position, etc. You can use this config if you often change your PC or visit cyber clubs. It will help you set all your parameters for a comfortable game in one click.
General config
This is a config that you can share with friends or other users. Such a config cannot contain any personal settings listed in the paragraph above. In this config you can reassign some keys, add useful functions, etc. Just don’t forget to decipher your config in an understandable way.
Adding a config to the game
To add your config to the game, you need to go to the CS2 configs folder. Go to your games library and select Counter-Strike 2. Select "Manage".
Next "Manage">>>"View local files"
Folder path:
\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg
After you have placed the config in the folder, you can open the game.
Running the config
To run your config, you need to go into the game and write in the console:
exec the name of your config Example: exec optyfine7.cfg
The name of the config must exactly match the name that you moved to the game folder.
Autorun config along with the game
If you want your config to immediately launch along with the game, then you need to write the launch parameters:
+exec the name of your config Example: +exec optyfine7.cfg
The config will be launched immediately along with the game, you will not need to enter a command to launch it each time.
End
I tried to explain the creation of my config in as detailed and understandable a form as possible.
I will continue if new ideas appear.
If you liked my guide, don't forget to rate it and leave a comment. This will help you understand how popular this topic is and whether it is important to the CS2 community.

This manual was written with the help of a translator. I apologize in advance for inaccuracies in translation.
1 comentários
L5Z 26 nov. 2023 às 23:31 
Is it possible to echo the value of a var? eg echo the sensitivity value? I'm unsure of the syntax and $sensitivity doesn't work