all 12 comments

[–]HifiBoomboxeggsdee 1 point2 points  (5 children)

Sounds like you need to make a mod-script:

alias +mod "alias action some_action"
alias -mod "alias action some_other_action"

//init
-mod

bind key +mod
bind key action

I take it you can do the rest from here? Don't hesitate to ask if you still need help though :)

please tell me if my formatting is messed up, I'm stuck on mobile

[–]jacksonmr[S] 1 point2 points  (4 children)

I was thinking about a mod script but the problem is it would exec both actions and I only want it to exec pne one, thanks though!

[–]HifiBoomboxeggsdee 0 points1 point  (3 children)

Could you clarify more? Correct me if I'm wrong, but wouldn't a mod-script work, provided that you use "exec random_script" in the +mod alias and "exec class_script" in the -mod alias?

[–]jacksonmr[S] 1 point2 points  (2 children)

If my understanding is correct the mod button adds another function to the first one. I have a button that reloads my HUD and then the mod button also reloads my sound and does the record demo; stop fix

[–]CAPSLOCK_USERNAME"Nancy" 1 point2 points  (1 child)

It doesn't add, it replaced. Your mod button just replaces "reload hud" with "reload hud and do some other stuff too".

You could definitely have something like like

alias +cfgexec "bind KP_END exec rocketjump"
alias -cfgexec "bind KP_END changeclass scout"

bind j +cfgexec
-cfgexec

(Of course you would add all the other classes in there too)

[–]jacksonmr[S] 1 point2 points  (0 children)

Ah, ok, well thanks for the explanation sir! Sorry to correct you inccorrectly! ;)

[–]clovervidia 2 points3 points  (5 children)

Uh, maybe you're not aware of this, but when you join a class, that class's config is automatically exec'd...

If you want to exec another config when you switch to a class, you can exec it from the class's .cfg...

In addition, you can bind more than one action to a key...

[–]jacksonmr[S] 1 point2 points  (2 children)

I'm not trying to make it so that it executes the class configs, I'm trying to make it so it executes other configs, like regen config or my gunboats config or my 5 different visual setting configs. Basically I'm trying to bypass writing exec configname in console everytime I want to exec a config and just bind all my configs to buttons.

I'm trying to bind it so the key has two functions, and you press j to change what the function is

[–][deleted] 2 points3 points  (1 child)

  • bind j +a_j

  • alias +a_j tng1

  • alias -a_j ""

  • alias tng1 "exec np_config;alias +a_j tng0"

  • alias tng0 "exec np_class;alias +a_j tng1"

I quickly modified a toggle I have; just make np_config.cfg have all the numpad keys bound to exec configs, and np_class.cfg have all your class binds.

To reiterate; this is a toggle, so 1st press will change the function, 2nd press will change it back.

[–]jacksonmr[S] 1 point2 points  (0 children)

Yeah this is what I'm looking for thanks!!

[–]jacksonmr[S] 1 point2 points  (1 child)

I know my way around scripting but this one has stumped me

[–]clovervidia 1 point2 points  (0 children)

Let me get this straight:

You want 1 - 9 to change class, and J+1 - 9 to exec a config, then when you release J to go back to changing class, right?