r/tf2scripthelp • • Oct 28 '15

Question Help with key combinations.

I'm trying to make a script that makes so when I hold down "f" and press 1, 2, 3, or 4, I switch to the corresponding loadout. I also have "+inspect" and "lastdisguise" bound to "f". I tried looking on the wiki, but I just can't figure it out. I've never understood the alias command very well. So, can one of you please help me out, and also possibly explain how it works, since I'm planning on making more key combos if I figure it out.

Edit: Welp, Scream Fortress is out. Guess I'll submit this post sometime later.

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/Eggsmuffins Oct 29 '15

Thank you so much, dude. One final question: For example, four_n or 2_m, are those specific commands/binds, or did is that what you decided to call them? Ok, 2 questions. There seems to be an extra layer of aliasing. Like you made an alias already for slot1, but then you have to make another different alias, for example one_k. Is this because of the key combinations or is it just the nature of the alias command?

2

u/Kairu927 Oct 29 '15

Anything immediately following the word alias is a name for an alias. So basically, I created some preset aliases ending in _n (for normal) and _m (for modified). They hold the commands for the normal use of the slot, and the use of the slot while the modifier is held.

However, for this sort of logic to work in the first place, we need the key set to an alias, and to modify that alias, so we create the _k aliases, which are what get modified.

The extra layer is the _n/_m itself. I could have just directly put in the +loadout alias something like this:

+loadout_mod "alias one_k load_itempreset 0; alias two_k load_itempreset 1; ..." 

For all the keys in one very long line. The _n and _m are just for readability and ease of use, so you have the nice little section at the top for adding/removing commands.


TL;DR:

I used _n and _m to just hold options settings, and used _k as "what the key is set to", and used loadout_mod to change the setting of _k.

1

u/Eggsmuffins Oct 29 '15

All right, thank you, dude, I'll start up TF2 and try to figure everything out.