Keybind Questions


Fringe

 

Posted

Hello. I'm a returning player and have been messing around with cleaning up some of my old keybinds. Any help would be highly appreciated.

I have the following bind that toggles between Sprint and Fly with the press of the same button:

ALT+BUTTON4 "powexec_name Sprint$$powexec_name Fly"

I would like to add Combat Jumping to the bind so that on the first press it will turn off Sprint and CJ while turning Fly on...the second press would do the opposite by turning Fly off while turning Sprint and CJ on.

Is this possible without having to use 2 different keys with 2 different binds?

Also, just to confirm...it appears as if once the keybinds file is loaded via the Options menu that the binds are saved server side for that character. Meaning that, I could load 1 file for 1 character and a different one for another character and not have to worry about re-loading files all the time. This seems to be the case but a confirmation would be nice on how that exactly works if anyone knows.

EDIT: I've been thinking about CJ and was wondering: Does the defense bonuses stack with those of Hover? Also, do the bonues remain active even if I'm flying?

If yes to either or both then I probably don't want to run CJ off when going into Hover / Fly...just sprint off...In which case, what would the bind be to turn both Sprint and CJ on with 1 button?

Thanks in advance.


 

Posted

Quote:
Originally Posted by Fringe View Post
I would like to add Combat Jumping to the bind so that on the first press it will turn off Sprint and CJ while turning Fly on...the second press would do the opposite by turning Fly off while turning Sprint and CJ on.
They've prevented the execution of multiple powers bound to a key or macro to keep people from scripting macrobots. Sorry, but your only option is to bind Combat Jumping to another key and toggle it separately.

Quote:
Originally Posted by Fringe View Post
Also, just to confirm...it appears as if once the keybinds file is loaded via the Options menu that the binds are saved server side for that character. Meaning that, I could load 1 file for 1 character and a different one for another character and not have to worry about re-loading files all the time. This seems to be the case but a confirmation would be nice on how that exactly works if anyone knows.
Yes, binds are saved to the server, not just kept locally. I've actually played on different computers, and all of my binds stay intact without me having to reload anything.

Binds loaded on one character don't carry over to any other characters, with one exception. There is a default keybind file (I think it's default.txt, but I could be wrong) that, when you create a character, will be loaded on them. If you modify this file, it won't affect any existing characters, but it will affect any new characters you create.


We've been saving Paragon City for eight and a half years. It's time to do it one more time.
(If you love this game as much as I do, please read that post.)

 

Posted

Quote:
Originally Posted by TonyV View Post
They've prevented the execution of multiple powers bound to a key or macro to keep people from scripting macrobots. Sorry, but your only option is to bind Combat Jumping to another key and toggle it separately.
Ok, thanks for the info.

Does this also mean that I couldn't bind Sprint & CJ to turn on and off with 1 key? Not sure if you can only toggle between 2 powers or if there was a way to toggle them both on with 1 press and both off with a second press.

Thanks again.


 

Posted

You might be able to do it with a rotating keybind

I have a rotating keybind set up for my fly/hover/sprint...

Flight1:
numpad0 "powexec_name sprint$$powexec_name hover$$bind_load_file c:\CoH_binds\flight2.txt"
uparrow "+forward$$powexec_name hover$$powexec_name fly"
leftarrow "+turnleft"
rightarrow "+turnright"
downarrow "+backward$$powexec_name hover$$powexec_name fly"
space "+up"
x "+down"

Flight2
numpad0 "powexec_name sprint$$powexec_name hover$$bind_load_file c:\CoH_binds\flight1.txt"
uparrow "+forward"
leftarrow "+turnleft"
rightarrow "+turnright"
downarrow "+backward"
space "+up"

One press of (numpad0) turns on "fly mode" and turns sprint off.
While in "fly mode" I can toggle between hover/fly depending on my movement

Second press of the key will turn off "fly mode" and turn sprint back on.

Dunno if you could work your combat jumping into something similar


Quote:
Don�t say things.
What you are stands over you the while, and thunders so that I cannot hear what you say to the contrary. - R.W. Emerson
The BIG consolidated LIST for BASE LUV
YUMMY Low-Hanging Fruit for BASE LUV

 

Posted

Quote:
Originally Posted by Impish_Kat View Post
As for toggling CJ/SJ with one key, yes, that can be done.

"powexec_name Combat Jumping$$powexec_name Super Jump"

1st - How are the load times with the separate bind files while playing? Is there any lag or any other noticeable delay when executing one or the other while moving around and such?

2nd - I don't want to toggle btw CJ and SJ but rather I would like to turn CJ and Sprint on with 1 press as opposed to toggling between the. Right now:

"powerexec_name Sprint$$powerexec_name Combat Jumping"

will turn Sprint off and CJ on or CJ off and Sprint on...I want to turn them both on or off at the same time with 1 key, if that's possible.

Thanks again.


 

Posted

Ahhhh, sorry, my mis-read...

1. I've found the rotating binds run pretty quickly. No delay that I've noticed.

2. I do have some powers set to fire on a downpress/release. One power fires on the downpress, the other on the release. The trick is to use the "+" in combination with the "toggleon" command. It can force a click power to behave like a toggle power within the command string. Here are some examples:

"+ $$powexec_toggleon Aim$$powexec_toggleon Build Up"
"+ $$powexec_toggleon Nova$$powexec_toggleon Conserve Power"
"+ $$powexec_toggleon Increase Density$$powexec_toggleon Speed Boost"

The last power in the string will fire first on the downpress. Then, since they are being labled as "toggles" the next power will fire on the release.
ETA: Since you are thinking of using powers that are already toggles, you may need to incorporate the "toggleoff" command in your string:

"+ $$powexec_toggleoff sprint$$powexec_toggleoff combat jump$$powexec_toggleon sprint$$powexec_toggleon combat jump"

IOW, to make the first down/up turn stuff on, and the second down/up turn stuff off. I understand several folks with Keld builds do this for switching between forms, though I don't know if I have the right of it.

NOTE: It is necessary to use a "paused press" technique with these binds. Else, if the release is too quick, it will just que up the last power again.

Here is some info I came across while looking into this sometime back:

Quote:
*** A note about the "+" and "++" prefixes in some of these commands ***

The short explanation of the + and ++ prefixes is that they represent how persistently the command will be carried out. Most of these keybindings represent "press and fire" commands -- that is, you press down on the button and the action will be performed once, until the button is pressed again.

With a "+" prefix the command will be carried out for as long as the button is pressed down, and ceases as soon as the button is no longer being pressed. For example, the default binding for the w key is +forward. For as long as the w key is pressed down your character will continue moving forward... but as soon as the button is no longer being pressed, the character stops moving.

With a "++" prefix the command will be toggled "on" and will continue to be activated until the button is pressed again, toggling it "off." If the w key were bound to ++forward, pressing the w key once would cause the character to move forward, and that character would continue to move forward until the w key were pressed again.

Any command that has a + prefix can work with a ++ prefix, and vice versa. This can lead to some redundant commands. For example, ++forward works exactly the same as ++autorun -- you run until you turn the command off.




Through trial and error, I've formed the following theory on how the "+" modifier works in binding.

The "+" modifier has two behaviors.
Behavior one: at all times when "+" is prepended to a command, it is the same as doing "command 1". Obviously this only works correctly on commands that take 1 or 0 as input. When other commands are prepended with it, it adds the 1 to the end of the arguments, and gives an error. This behavior is mirrored by the "-" modifier, which yields argument 0.

Behavior two: ( Only when directly in the bind.. in other words this does not work when made a macro which you then bind to a key! )when prepended to the first command in a bind (assuming that command is one that works with it, ie takes 1/0 argument), it gives the entire bind statement a "press/unpress" behavior. This means two things:

* a) the command prepended with the "+" turns on (aka is given argument 1) when you press the key as you would expect per behavior 1. Additionally it turns off (argument 0) when you unpress the key
* b) the rest of the commands in the bind are performed once when you press the key, and again when you unpress it

Note that this behavior is not mirrored by the "-" modifier.. it might be nice if it did at least the first part, ie turn a command off when you press the key and back on when you unpress, but it doesn't.

Side note: I am actually a bit surprised that they decided to overload the use of the "+" in this way. It seems to me it would have been more intuitive and useful to have another character modifier (> for instance) to prepend to a bind statement (without a necessary command after it) to extend the second behavior, with the addition that any commands following in the statement with a "+" would work in the on/off manner when press/unpressed instead of just the first one.

The secondary behavior of the "+" in binds makes several useful things possible. Especially when you realize that the first command doesn't always have to do something, since you can always override it with a "-" form of it elsewhere in the bind. For instance a simple yet very useful bind for fly which makes you fly only while you hold down "f":

* /bind f "+up$$-up$$powexec_name Fly"



Another behavior can be achieved by exploiting the "overwrite" effect of powers (aka if several powers are entered one after the other in a bind, only the last one will go off in most cases). A very useful binding for getting out of melee range quickly with hover is:

* /bind v "+up$$powexec_name Hover$$powexec_name Hover"


This makes you jump and then hover up in the air just out of melee range. Note the doubling up of the hover power.. this is because if you only have it once in the bind, it will turn hover on when you press it and off when you let go (usually.. sometimes the hover from press and hover from unpress go through together and one gets overwritten, but this is rare). Why doesn't it turn on/off quickly when you press it and on/off quickly when you let go if you enter it twice? Because of the power overwrite effect.. while it is busy doing the jump when you press the button down, both hovers go through and the second overwrites the first, resulting in hover being turned on. When you let go, it stops the jump and both hovers go through, turning hover off and back on very quickly (before you drop) resulting in you being left in hover mode. This causes a bit of spam to your combat messages window, but it's worth it. Note: the differing behavior here (ie overwrite happening on press but not on unpress) I believe is due to the interaction between commands and powers on timing in a bind, but this is just a guess.


Quote:
Don�t say things.
What you are stands over you the while, and thunders so that I cannot hear what you say to the contrary. - R.W. Emerson
The BIG consolidated LIST for BASE LUV
YUMMY Low-Hanging Fruit for BASE LUV

 

Posted

Thank you so much for posting all of that. It certainly helped me to understand enough to come up with the following binds that have resolved my concerns:

BUTTON4 "+up"
CTRL+BUTTON4 "powexec_name Sprint$$powexec_name Hover"
SHIFT+BUTTON4 "+ $$powexec_toggleon Sprint$$powexec_toggleon Combat Jumping$$powexec_toggleoff Hover$$powexec_toggleoff Fly"
ALT+BUTTON4 "powexec_name Sprint$$powexec_name Fly"

I know it's not perfect by any means but what I'm able to do is to log on and use Shift+Button4 to toggle both Sprint and Combat Jumping on at the same time. I see what you mean about being slow on the release but it works nice so I'm good with that. I added the toggleoff for Hover and Fly just for the heck of it. I can then toggle Sprint off while toggling Hover or Fly on with either Alt+ or Ctrl+Button4.

Once I have both Sprint and CJ on via the single button press...the Hover / Fly toggles only turn Sprint off and leave CJ alone. Therefore, I only need to use the Sprint / CJ toggle once, when I first log on (or if they ever get disabled by a mob).

Again, not perfect but I like it.

Oh, 1 more question: Does Sprint and Super Speed stack? In other words, should I create a bind to toggle 1 off and 1 on or should they both be on at the same time? EDIT: Nevermind. I learned that they do stack but there's a cap to consider.

Thanks a lot everyone.