Upvote Upvoted 0 Downvote Downvoted
Is it possible to "program" configs?
posted in Customization
1
#1
0 Frags +

I'm trying to solve a problem with my medic.cfg.
I want to disable rendering the medi gun via r_drawviewmodel, but not the other weapons.
That would be simple enough:

bind 1 "slot1;viewmodel_fov 110; r_drawviewmodel 1"
bind 2 "slot2;viewmodel_fov 0; r_drawviewmodel 0"

Note: I change the viewmodel FOV to 0 to hide the medi gun beam.

However, If I decide to disable rendering all of the medic weapons using the same command, the binding above would overwrite it as soon as I switch from the medi gun.

Is it possible to make it work by somehow creating conditions or variables?

I'm trying to solve a problem with my medic.cfg.
I want to disable rendering the medi gun via r_drawviewmodel, but not the other weapons.
That would be simple enough:
[code]bind 1 "slot1;viewmodel_fov 110; r_drawviewmodel 1"
bind 2 "slot2;viewmodel_fov 0; r_drawviewmodel 0"
[/code]

Note: I change the viewmodel FOV to 0 to hide the medi gun beam.

However, If I decide to disable rendering all of the medic weapons using the same command, the binding above would overwrite it as soon as I switch from the medi gun.

Is it possible to make it work by somehow creating conditions or variables?
2
#2
9 Frags +

You can do something like that with aliases.

you can do

alias customslot1 "slot1; r_drawviewmodel 1"
bind 1 customslot1

and your enable/disable command would then have to realias customslot1, i.e. in your global disable command you'd do

alias customslot1 "slot1; r_drawviewmodel 0"

and in your enable command you'd do

alias customslot1 "slot1; r_drawviewmodel 1"
You can do something like that with aliases.

you can do
[code]
alias customslot1 "slot1; r_drawviewmodel 1"
bind 1 customslot1
[/code]

and your enable/disable command would then have to realias customslot1, i.e. in your global disable command you'd do

[code]
alias customslot1 "slot1; r_drawviewmodel 0"
[/code]

and in your enable command you'd do

[code]
alias customslot1 "slot1; r_drawviewmodel 1"
[/code]
3
#3
2 Frags +

Oh, it's that simple really. Thank you!

Oh, it's that simple really. Thank you!
4
#4
1 Frags +

idk if it matters to you but having general aliases for stuff that gets repeated a bunch cleans it up a fair bit.
alias novm "r_drawviewmodel 0;viewmodel_fov 0"
Alias vm "...."

Type of thing, if you're into making/messing around with it yourself. mostly applicable with crosshair switching and viewmodel stuff, with both having much better and accessible alternatives nowadays. Just food for thought I suppose.

idk if it matters to you but having general aliases for stuff that gets repeated a bunch cleans it up a fair bit.
alias novm "r_drawviewmodel 0;viewmodel_fov 0"
Alias vm "...."


Type of thing, if you're into making/messing around with it yourself. mostly applicable with crosshair switching and viewmodel stuff, with both having much better and accessible alternatives nowadays. Just food for thought I suppose.
Please sign in through STEAM to post a comment.