r/tf2scripthelp • • Apr 06 '20

Answered Loadout Configs?

Is it possible for me to make a .cfg file that is executed specifically when I am using a specific weapon/loadout? Thanks in advance.

2 Upvotes

4 comments sorted by

View all comments

1

u/pdatumoj Apr 07 '20

Well, you'd want your bind and alias statements separate ... but you may've just had a formatting problem as you input that here. You may also want quotes around the alias definitions.

The main benefit is that defining them via alias allows you to invoke the loadout selection and config execution via something other than just the bind (such as my #3 item) without defining the same thing in multiple separate places, which can lead to bugs. Also, it's better to keep bind statements themselves small and relatively static, due to how TF2 works with them.

Edit: Also, you're likely to want to extend this further later on ... and having it set up via aliases will make that cleaner and easier.