Playing around with bindings, how can I do things like, for example, having a command be executed when a key [I]stops[/I] being pressed, or having a bind that requires two keys to be used?
You can use +cmd to execute when button is pressed and then -cmd when the button is released. I believe you need both commands for the last to work. You bind the +cmd to a key.
If you bind a key to +command, it will automatically execute -command if you release the key.
To have a bind require two keys to be used, you could do this:
alias command "say pressed!"
alias +set_a "bind a command"
alias +set_b "bind b command"
alias -set_a "bind a +set_b"
alias -set_b "bind b +set_a"
-set_a; -set_b
[editline]12th August 2013[/editline]
[url=http://wiki.teamfortress.com/wiki/Scripting]This[/url] might be useful. (Most commands and mechanics apply to all Source games)
but the commands I want to bind on keyrelease doesn't come in +/- mode, and I'm using 2 of them...
(yes, I'm using lua functions as commands)
What exactly do you want to do?
I'm using an addon called Grymod (you can get it on the workshop), but it recreates the Crysis 1 nanosuit, not the Crysis 2/3 one. I want to bind make the Grymod bindings to be a little more like the Crysis 2/3 nanosuit, and to start, I want to bind the Speed (DON'T confuse with +speed) and Armor command, which are NOT +/-, to the sprint button (shift) in a way so when I sprint, speed mode kicks in, and when I release the sprint button, armor mode kicks in.
If you're wondering, yes, I took the addon apart to analyze the lua, but no, I will NOT redistribute it. I'm only tweaking it to my personal liking.
Sorry, you need to Log In to post a reply to this thread.