Counter-Strike 2
Оцінок: 64
A better method to display on screen any text / console output (including damage)
Автор: Mos_
If you use the developer console to display damage given / taken, you probably noticed that you can't use more than one filter at a time, and it sucks. In this guide, i give you a workaround to remove this limitation and auto switch between multiple filters on the fly. Which allows you to create custom overlays and visual feedbacks for your scripts. This guide also contains modified examples of the most used scripts such as volume toggle, sensivity switch, voice chat toggle, etc...
   
Нагородити
До улюбленого
В улюблених
Прибрати
Update 11/2022
This method doesn't work on official servers anymore :(

I stopped playing cs for a while so didn't notice until now, but Valve decided to disable developer console on official servers with the 02/17/22 update (1.38.1.6). The patchnote says :

  • Added server convar sv_max_allowed_developer that determines highest developer value for attached clients

From what I've read, it seems to be related to potential performance problems in game when dev console was enabled. Which is sad cause this overlay was damn useful IG.

The method itself still works, but only on community servers and only if sv_max_allowed_developer is set to 1.

The "old" method

This is the kind of tweak that everybody uses to display damage

// Enable developer console and filter the output developer "1" con_enable "1" con_filter_enable "2" con_filter_text "Damage Given" con_filter_text_out "Player:"


And here is an example of script to toggle in game voices and print current value

bind "F8" "voice_enable 0; clear; echo damage_[~VOICE_DISABLED~]" bind "F9" "voice_enable 1; clear; echo damage_[~VOICE_ENABLED~]"


Using this method, the script above will show something like this



Well, at least it works, adding "damage_" before every text you want to display does the trick, but to be honest, it also looks bad, doesn't it? Plus, this offers some very limited usage, mainly because you can print nothing except the "echo" you have created yourself.


The alternative

After a lot of try and error, i finally ended up with this. A script that automatically changes the console filter according to what it has to display. Once the command is completed, it will fall back to a default value (Damage Given in our case). This also offers countless possibilities, because the filter can be modified on the fly everytime it's needed.



Let's use this new method to display sensitivity for example

// Declare custom filters alias "filter_sensi" "con_filter_text sensitivity" alias "reset_filter" "con_filter_text Damage Given" // Give an alias to a key on the keyboard/mouse bind "F8" "+mouse_sensi" // Custom filter will be applied when key is pressed alias "+mouse_sensi" "filter_sensi" // Trigger the action when key is released. Reset the filter once the command is completed alias "-mouse_sensi" "clear; sensitivity; reset_filter"


Then, when pressing F8, the sensi value will show up.




At least, it is very flexible and will work in pretty much every situation, the only limit will be what the filter can handle, especially concerning special chars. But you can litteraly print every console output, whatever the text contains. And all of that with only one bind! No need to manually switch between filters. Or to use the pattern "damage_[~some_message~]" anymore.


Examples


Here you will find some useful and practical scripts, modified with this new method. As a good lazy ass, i don't have written all those entirely by myself. You'll find links to the original scripts i used at the bottom.

NOTE : Pastebin links have been updated. All the scripts given here should now work without problem.


Volume control




Mute / Unmute voice chat




Radar scaling




Sensitivity switch




How To

- Go to steam folder
C:\Program Files\Steam\SteamApps\common\Counter-Strike Global Offensive\csgo\cfg

- Download this file and copy paste it in the steam folder
sample_scripts[www.archive-host.com]

- Open up the console and type this command
exec sample_scripts


If the config has been successfully loaded, this message will be displayed in the console.



Also, it is recommended to edit the file and change the binds to fit your needs.


If you want to disable it and revert to your previous config you need to :

- Suppress the file from the steam folder

- Restart the game and type this command in the console
developer "0"

Which will completely disable text display on screen (damage included).


Коментарів: 34
Lesewetter 20 черв. 2023 о 12:54 
aw okay, thanks a lot for the information :TreepileHeart:
Mos_  [автор] 20 черв. 2023 о 11:05 
@Sanse The method itself still works but only if 'sv_max_allowed_developer' is set to 1 (server side command). Which was the default value on official servers until 2022.

The problem is, Valve has decided to disable developer console on offi in feb 2022 because of performance issues in some cases. And as a side effect, it completely removed the ability to use this kind of script in ranked. Also I never tried but I don't think it works on faceit or esea either.

So yeah, apart from local or community servers it's kinda dead :/
Lesewetter 17 черв. 2023 о 14:31 
It's not working anymore right? Or is my config broken?
aeyde 23 серп. 2021 о 14:17 
how do i add static text?
MarvoldX || FREE PALESTINE 29 трав. 2021 о 7:17 
anyway to show more than 6 strafes ? for kz
$Kolega 16 січ. 2021 о 14:55 
Alright, thank you man. Keep the good work up ☝🏽
Mos_  [автор] 16 січ. 2021 о 12:53 
Hey @Kolega1103 and sorry for the late answer. For what I know there is no option to move the output from one corner to another. Maybe a workaround exists and i'll share it if I find one but I don't think it's possible sadly.
$Kolega 28 груд. 2020 о 19:13 
Hey, do you know how to change the output from top left corner to the top right corner? Would be really helpful! Thank you :b3d_sweet:
[B4L]..::crowN::.. 1 трав. 2019 о 8:33 
I write another script basic on this, who toggles one key to enable/disable the voice.

//Voice ON/OFF script
alias "filter_voice" "con_filter_text voice_";
alias "reset_filter" "con_filter_text Damage";

bind "k" "+voice_on";

alias "+voice_on" "filter_voice"; voice_enable 1; echo voice_enabled;
alias "+voice_off" "filter_voice"; voice_enabled 0; echo voice_disabled;

alias "-voice_on" "clear; voice_enable 1; echo voice_enabled; bind "k" "+voice_off"; reset_filter;
alias "-voice_off" "clear; voice_enable 0; echo voice_disabled; bind "k" "+voice_on"; reset_filter;
lars 9 серп. 2018 о 2:34 
Thanks man, really helped me out!