The Incomplete and Unofficial Guide to /bind: Difference between revisions

From Unofficial Homecoming Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{PlayerGuide}}
{{TOCright}}
{{TOCright}}
== Introduction ==
== Introduction ==


Welcome to The Incomplete and Unofficial Guide to /bind, an attempt to collect all the information we know about the bind command and organize it in a way that will make using it a lot easier to understand.  Bind is a very powerful tool for customizing the way you play your game, and while it is a little confusing to use when you first get into it, it gets easier the more you play with it.
Welcome to The Incomplete and Unofficial Guide to {{slashcommand|bind}}, an attempt to collect all the information we know about the bind command and organize it in a way that will make using it a lot easier to understand.  Bind is a very powerful tool for customizing the way you play your game, and while it is a little confusing to use when you first get into it, it gets easier the more you play with it.


This guide will (hopefully) make it easier for you to:
This guide will (hopefully) make it easier for you to:


* Understand what the /bind command does
* Understand what the {{slashcommand|bind}} command does
* Get a solid grasp on how it works, so you can play around with it on your own, and
* Get a solid grasp on how it works, so you can play around with it on your own, and
* Immediately start using /bind to remap your keyboard and mouse in ways that the basic options in-game will now allow
* Immediately start using {{slashcommand|bind}} to remap your keyboard and mouse in ways that the basic options in-game will now allow
 
=== Understanding What /Bind Is ===


City of Heroes comes with a set of predefined in-game navigation and control commands.  Pressing the W key moves your character forward, pressing the A key rotates your character to the left, pressing the D key rotates your character to the right, and so on.  If you are not happy with these commands, you can open up the options panel, press the controls button, and replace some of them with key strokes or mouse button clicks of your own choosing.  But you cannot do this with every single key in the game.  If you want more control over how the in-game commands are assigned to keys, you must use /bind.
=== Understanding What {{slashcommand|Bind}} Is ===


In its simplest form, /bind tells the game, "From now on, when this button is pressed, I want you to trigger that action." That action could be anything—start a power, bring up a user interface panel, send a message to another player, and so on.  It is even possible to assign multiple actions to the same bind, though there are limits, and the more complex your /bind, the greater a chance that something unexpected (and perhaps unwanted) will happen.  That button can be almost any button on your keyboard or mouse, though again there are some limitsEssentially, /bind is telling the game that when you press the F key you want to activate the Hover power.
City of Heroes comes with a set of predefined or default in-game navigation and control commandsPressing the W key moves your character forward, pressing the A key rotates your character to the left, pressing the D key rotates your character to the right, and so on.  If you are not happy with these commands, you can open up the options panel, press the Keymapping tab, and replace some of them with key strokes or mouse button clicks of your own choosingBut you cannot do this with every single action in the game.  If you want more control over how the in-game commands are assigned to keys, you must use {{slashcommand|bind}}.


=== What /Bind Is Not ===
In its simplest form, {{slashcommand|bind}} tells the game, "From now on, when this button is pressed, I want you to trigger that action."  That action could be anything—start a power, bring up a user interface panel, send a message to another player, and so on.  It is even possible to assign multiple actions to the same bind, though there are limits, and the more complex your {{slashcommand|bind}}, the greater a chance that something unexpected (and perhaps unwanted) will happen.  That button can be almost any button on your keyboard or mouse, though again there are some limits.  Essentially, {{slashcommand|bind}} is telling the game that when you press the F key you want to activate the Hover power. Binds that players create are Custom Keybinds.


/bind is not a macro language, and it cannot be used to automate your actions.  In some games it is popular to write macros or shortcuts that allow you to queue up a number of attacks.  For example, to start out with [[Super Strength#Jab|Jab]], then [[Super Strength#Punch|Punch]], then [[Super Strength#Haymaker|Haymaker]], and then to repeat until you no longer have a target.  This is not possible using /bind, though it is possible to do some interesting things with it that come close.
=== What {{slashcommand|Bind}} Is Not ===
{{slashcommand|bind}} is not a macro language, and it cannot be used to automate your actions.  In some games it is popular to write macros or shortcuts that allow you to queue up a number of attacks.  For example, to start out with [[Super Strength#Jab|Jab]], then [[Super Strength#Punch|Punch]], then [[Super Strength#Haymaker|Haymaker]], and then to repeat until you no longer have a target.  This is not possible using {{slashcommand|bind}}, though it is possible to do some interesting things with it that come close.


There are in fact macros in the game, but they are slightly different than macros in other games.  Macros will also be covered at the end of this guide, since they share many similarities to /bind (and enough differences to make them important).  
There are in fact "macros" in the game, but they are different than macros in other games.  Macros will also be covered at the end of this guide, since they share many similarities to {{slashcommand|bind}} (and enough differences to make them important).  


== Using /Bind: The Basics ==
== Using {{slashcommand|Bind}}: The Basics ==


Before you can understand how to use /bind properly, you need to know how to use [[Slash Commands|slash commands]].  Slash commands are commands that you send to the game while using the chat window.  /Bind is a slash command, so understanding how they work in general will help you understand how to use /bind specifically.
Before you can understand how to use {{slashcommand|bind}} properly, you need to know how to use [[Slash Commands|slash commands]].  Slash commands are commands that you send to the game while using the chat window.  {{slashcommand|Bind}} is a slash command, so understanding how they work in general will help you understand how to use {{slashcommand|bind}} specifically.


=== Tangent: A Brief Guide to Slash Commands ===
=== Tangent: A Brief Guide to Slash Commands ===
Line 32: Line 29:
While you are in-game, press your ENTER key.  You will see a flashing prompt in your chat window.  You have probably used this any number of times to say something to other players in game, either through the local, team, broadcast or query channels.  You may also know that if you append certain words to a slash ("/"), they will be interpreted as in-game commands.  For example, if you have ever fallen through the city and find yourself standing in the middle of a big blue void, with the ghostly image of the city hanging above your head, you might press the ENTER key and type
While you are in-game, press your ENTER key.  You will see a flashing prompt in your chat window.  You have probably used this any number of times to say something to other players in game, either through the local, team, broadcast or query channels.  You may also know that if you append certain words to a slash ("/"), they will be interpreted as in-game commands.  For example, if you have ever fallen through the city and find yourself standing in the middle of a big blue void, with the ghostly image of the city hanging above your head, you might press the ENTER key and type


: /stuck
: {{slashcommand|stuck}}


And voila!  You reappear at the entrance to the zone you were just in.  City of Heroes saw the slash in front of "stuck" and realized that you were sending it a command.  It then looked up "stuck" and saw that it needed to return you to the proper zone, and *poof*—it was done.
And voila!  You reappear at the entrance to the zone you were just in.  City of Heroes saw the slash in front of "stuck" and realized that you were sending it a command.  It then looked up "stuck" and saw that it needed to return you to the proper zone, and *poof*—it was done.


Any time you put a slash in front of text in your chat window, City of Heroes interprets the word that follows as though it were a command, whether the command exists or not. For example, /g tells City of Heroes that all of the text following the "g" should be sent to the group channel (or the team channel).
Any time you put a slash in front of text in your chat window, City of Heroes interprets the word that follows as though it were a command, whether the command exists or not. For example, {{slashcommand|g}} tells City of Heroes that all of the text following the "g" should be sent to the group channel (or the team channel).


So if you type:
So if you type:


: /g I'd really like a ham sandwich.
: {{slashcommand|g}} I'd really like a ham sandwich.


Anyone in my team would see the following message:
Anyone in my team would see the following message:
Line 46: Line 43:
: I'd really like a ham sandwich.
: I'd really like a ham sandwich.


Some commands are a little more complicated.  Not only will the game need to know the general command to tell it what to do, it will need a few pointers to show it how or where to do it.  For example, /t or /tell informs the game that you want to send a single character on the server a private message.  But which character?
Some commands are a little more complicated.  Not only will the game need to know the general command to tell it what to do, it will need a few pointers to show it how or where to do it.  For example, {{slashcommand|t}} or {{slashcommand|tell}} informs the game that you want to send a single character on the server a private message.  But which character?


The proper way to send a tell is to type the following:
The proper way to send a tell is to type the following:


: /t ''character name'', Hey! Want to group?
: {{slashcommand|t}} ''character name'', Hey! Want to group?


''character name'' in this case represents someone's actual name.  So what you have to do is use the /t command, then enter the character's name, then use a comma to separate the instructions from the message, then type the message.  So:
''character name'' in this case represents someone's actual name.  So what you have to do is use the {{slashcommand|t}} command, then enter the character's name, then use a comma to separate the instructions from the message, then type the message.  So:


: /t Curveball, Hey! Want to group?
: {{slashcommand|t}} Curveball, Hey! Want to group?


Would cause the message "Hey! Want to group?" to show up in Curveball's text window.
Would cause the message "Hey! Want to group?" to show up in Curveball's text window.
Line 60: Line 57:
All this really means is that when you are using a complicated slash command, you often have to be very specific in telling City of Heroes what you want to happen, and that often you have to give it that information in a very specific way.  For example, if you typed
All this really means is that when you are using a complicated slash command, you often have to be very specific in telling City of Heroes what you want to happen, and that often you have to give it that information in a very specific way.  For example, if you typed


: /t Curveball Hey! Want to group?
: {{slashcommand|t}} Curveball Hey! Want to group?


City of Heroes wouldn't know what to do.  For all it knows, the character you are trying to send a message to is named "Curveball Hey! Want to group?" which is impossible, since the name field is not long enough and does not allow exclamation points or question marks.  The comma after the name is very, very important, because it tells the game "I have told you who to send the message to, now I am going to tell you the message."
City of Heroes wouldn't know what to do.  For all it knows, the character you are trying to send a message to is named "Curveball Hey! Want to group?" which is impossible, since the name field is not long enough and does not allow exclamation points or question marks.  The comma after the name is very, very important, because it tells the game "I have told you who to send the message to, now I am going to tell you the message."
Line 66: Line 63:
Slash commands may optionally have underscores in them.  Any underscores in a slash command are ignored by City of Heroes.  This feature is handy for commands that are composed of multiple words to make the command more clear.  For example, all of the following commands are functionally equivalent:
Slash commands may optionally have underscores in them.  Any underscores in a slash command are ignored by City of Heroes.  This feature is handy for commands that are composed of multiple words to make the command more clear.  For example, all of the following commands are functionally equivalent:


: /powexecname Temp Invulnerability
: {{darkblue|/powexecname}} Temp Invulnerability
: /pow_exec_name Temp Invulnerability
: {{darkblue|/pow_exec_name}} Temp Invulnerability
: /_p_o_w_e_x_e_c_n_a_m_e_ Temp Invulnerability
: {{darkblue|/_p_o_w_e_x_e_c_n_a_m_e_}} Temp Invulnerability


But the second version is arguably the most clear and readable.  In binds, no underscores are typically used so that more characters may be used in the command's parameters.  However, underscores are used in some game documentation and in keybind files (covered in a later section) and in this guide.
But the second version is arguably the most clear and readable.  In binds, no underscores are typically used so that more characters may be used in the command's parameters.  However, underscores are used in some game documentation and in keybind files (covered in a later section) and in this guide.
Line 74: Line 71:
=== Bringing the Tangent Back On-Topic ===
=== Bringing the Tangent Back On-Topic ===


That is all well and good, you ask, but what does that have to do with /bind?  Well, two things:
That is all well and good, you ask, but what does that have to do with {{slashcommand|bind}}?  Well, two things:


* First, /bind is a slash command, and you need to know how slash commands work in general.
* First, {{slashcommand|bind}} is a slash command, and you need to know how slash commands work in general.
* Second, /bind is a slash command that can trigger other slash commands.
* Second, {{slashcommand|bind}} is a slash command that can trigger other slash commands.


=== Format of the /Bind Command ===
=== Format of the {{slashcommand|Bind}} Command ===
 
{{slashcommand|Bind}}, like {{slashcommand|t}} or {{slashcommand|tell}}, requires that you format your command very specifically.  The basic layout of a properly constructed {{slashcommand|bind}} command is:
/Bind, like /t or /tell, requires that you format your command very specifically.  The basic layout of a properly constructed /bind command is:


: {{slashcommand|bind|trigger "command"}}
: {{slashcommand|bind|trigger "command"}}


First you identify the slash command (/bind), then you identify what key will start the command (''trigger''), and then you place quotes around what the /bind actually does (''command'').
First you identify the slash command (/bind), then you identify what key will start the command (''trigger''), and then you place quotes around what the {{slashcommand|bind}} actually does (''command'').


Of course, none of that makes any sense unless you know what a trigger is and what a command is.
Of course, none of that makes any sense unless you know what a trigger is and what a command is.
Line 95: Line 91:
* single key
* single key
* combination of keys
* combination of keys
* mouse click, or
* mouse click,
* key and mouse click combination
* key and mouse click combination,
* game controller/joystick button, or
* combination of game controller buttons


A trigger activates the /bind command.  It can be pressing the E key, or clicking mouse button 1, or pressing the left shift key in combination with either the E or mouse button 1.  Combinations of keys and mouse buttons allow you to map a lot of very specific commands to a limited number of keys, provided you can keep track of all of them.
A trigger activates the {{slashcommand|bind}} command.  It can be pressing the E key, or clicking mouse button 1, or pressing the left shift key in combination with either the E or mouse button 1.  Combinations of keys and mouse buttons allow you to map a lot of very specific commands to a limited number of keys, provided you can keep track of all of them.


Each key has a name that /bind uses to differentiate it from other keys.  The majority of the names are pretty easy to figure out.  For example, the E key is "E", and the F1 key is "F1."  But because some keys on your keyboard share the same name, City of Heroes has assigned them unique, more complex names to set them apart.  For example:
Each key has a name that {{slashcommand|bind}} uses to differentiate it from other keys.  The majority of the names are pretty easy to figure out.  For example, the E key is "E", and the F1 key is "F1."  But because some keys on your keyboard share the same name, City of Heroes has assigned them unique, more complex names to set them apart.  For example:


* LSHIFT: the shift key on the left side of your keyboard
* LSHIFT: the shift key on the left side of your keyboard
Line 111: Line 109:
Some special keys called ''chord keys'' can be used in combination with other keys and mouse buttons.  They do not act as triggers themselves, but can be used with trigger keys to make new triggers.
Some special keys called ''chord keys'' can be used in combination with other keys and mouse buttons.  They do not act as triggers themselves, but can be used with trigger keys to make new triggers.


For example, suppose you have set up the E key to trigger your Tanker's [[Invulnerability#Temp Invulnerability|Temp Invulnerability]] power.  In this case, E is a trigger; when you press it, it causes the power to activate.  So the /bind command might look like this:
For example, suppose you have set up the E key to trigger your Tanker's [[Invulnerability#Temp Invulnerability|Temp Invulnerability]] power.  In this case, E is a trigger; when you press it, it causes the power to activate.  So the {{slashcommand|bind}} command might look like this:


: /bind e "''power activation command''"
: {{slashcommand|bind}} e "''power activation command''"


(The specifics of the command are not important at the moment.  It will be dealt with in the next section. )
(The specifics of the command are not important at the moment.  It will be dealt with in the next section. )
Line 119: Line 117:
The E key is very convenient to access in combat, and if you want you can combine it with a chord key in order assign another command to it.  So you could have something like:
The E key is very convenient to access in combat, and if you want you can combine it with a chord key in order assign another command to it.  So you could have something like:


: /bind LSHIFT+E "''another power activation command''"
: {{slashcommand|bind}} LSHIFT+E "''another power activation command''"


which would tell the game "when the left shift chord key key is pressed, and then (while the left shift key is still pressed down) the E trigger key is pressed, execute the following command."
which would tell the game "when the left shift chord key key is pressed, and then (while the left shift key is still pressed down) the E trigger key is pressed, execute the following command."
Line 125: Line 123:
In the first example, pressing the E key allows you to trigger a power.  In the second example, pressing the left shift key and E key together allows you to trigger another power entirely—the shift key is essentially making the E key a completely new trigger.
In the first example, pressing the E key allows you to trigger a power.  In the second example, pressing the left shift key and E key together allows you to trigger another power entirely—the shift key is essentially making the E key a completely new trigger.


When you are setting up a chord key and trigger key combination, separate them with the "+" symbol.  This tells the game that you are using both keys together.  /Bind commands are read from left to right, so if you are using chords in a trigger you must always use the chord key first. If you typed:
When you are setting up a chord key and trigger key combination, separate them with the "+" symbol.  This tells the game that you are using both keys together.  {{slashcommand|Bind}} commands are read from left to right, so if you are using chords in a trigger you must always use the chord key first. If you typed:


: /bind e+lshift "''another power activation command''"
: {{slashcommand|bind}} e+lshift "''another power activation command''"


The game would read it as:
The game would read it as:


: /bind e "''another power activation command''"
: {{slashcommand|bind}} e "''another power activation command''"


and overwrite your original e binding.  It does this because e is a trigger key and cannot chord, so it sees "oh, there's an E, I can't do anything else" and skips right to the command in quotation marks.
and overwrite your original e binding.  It does this because e is a trigger key and cannot chord, so it sees "oh, there's an E, I can't do anything else" and skips right to the command in quotation marks.
For a complete list of keys and buttons available for players to use with {{slashcommand|bind}}, see [[List of Key Names]].


=== Commands ===
=== Commands ===


Commands are the instructions the game follows when a trigger is pressed. Commands are usually other slash commands.  In fact, most of the time when you create a /bind, you are assigning a slash command to a key or mouse button.
Commands are the instructions the game follows when a trigger is used. When talking about [[Binds|binds]], commands are usually other slash commands.  In fact, most of the time when you create a {{slashcommand|bind}}, you are assigning a slash command to a key or button.


But what are these commands?  There are a lot of them, and they are scattered around the forums, but the most important ones can be found in these two locations:
But what are these commands?  There are a lot of them, and they can be found in these two locations:


* [[Default Key Bindings]], which provides a list of all the default key bindings.
* [[Keybind Profiles]], which provides lists of the different sets of default key bindings that a player may select.
* [[Slash Commands]], which provides a list of all the slash commands.
* [[List of Slash Commands]], which provides a list of all the slash commands.


=== Putting it all together ===
=== Putting it all together ===


Now that you know what triggers are, what types of things those triggers can make happen, let's look at a simple /bind command:
Now that you know what triggers are, what types of things those triggers can make happen, let's look at a simple {{slashcommand|bind}} command:


: /bind E "pow_exec_name Temp Invulnerability"
: {{slashcommand|bind}} E "pow_exec_name Temp Invulnerability"


This tells the game that whenever the e key is pressed, the power "Temp Invulnerability" should activate.
This tells the game that whenever the e key is pressed, the power "Temp Invulnerability" should activate.
Line 158: Line 158:
And the power would trigger (assuming you had it).  By binding that command to the E key, you save a lot of time, especially in combat.
And the power would trigger (assuming you had it).  By binding that command to the E key, you save a lot of time, especially in combat.


One of the things you will notice in the /bind example is that in the /bind, the slash command was called without the actual "/."  /Bind assumes that you are going to send it a slash command, so the slash is unnecessary, and if you use the slash it will not work.
One of the things you will notice in the {{slashcommand|bind}} example is that in the {{slashcommand|bind}}, the slash command was called without the actual "/."  {{slashcommand|Bind}} assumes that you are going to send it a slash command, so the slash is unnecessary, and if you use the slash it will not work.


=== Correcting mistakes ===
=== Correcting mistakes ===
{{SlashCommandArticle
{{SlashCommandArticle|command=unbind|options=key|note=/unbind ''key'' entirely removes the custom binding on ''"key"'' and restores its default behaviour}}.
|command=unbind|options=key|note=/unbind ''key'' entirely removes the binding of ''key'' and restores its default behaviour}}.
{{SlashCommandArticle|command=unbind_all|note=/unbind_all removes all custom bindings from all triggers and restores the game's default keybindings for the currently selected [[Keybind Profiles|Keybind Profile]]}}.


== Binding Multiple Commands to the Same Key ==
== Binding Multiple Commands to the Same Key ==


The previous example was the simplest form of a /bind command: a key triggered a single action.  Sometimes you might want to do something a little more complicated, to set up a bind so that when a single key is pressed, multiple things happen simultaneously.
The previous example was the simplest form of a {{slashcommand|bind}} command: a key triggered a single action.  Sometimes you might want to do something a little more complicated, to set up a bind so that when a single key is pressed, multiple things happen simultaneously.


In keeping with our previous example, let's say that when the Temporary Invulnerability power is triggered you want to have your character say "I am invincible!"  Well, that action is actually two slash commands:
In keeping with our previous example, let's say that when the Temporary Invulnerability power is triggered you want to have your character say "I am invincible!"  Well, that action is actually two slash commands:


* /powexec_name Temp Invulnerability
* {{slashcommand|powexec_name}} Temp Invulnerability
* /local I am invincible!
* {{slashcommand|local}} I am invincible!


To do this, you need a way to tell /bind, "But wait, I want you to do something else."  You do this by inserting "$$" between the two commands:
To do this, you need a way to tell {{slashcommand|bind}}, "But wait, I want you to do something else."  You do this by inserting "$$" between the two commands:


: /bind E "local I am invincible!$$pow_exec_name Temp Invulnerability"
: {{slashcommand|bind}} E "local I am invincible!$$pow_exec_name Temp Invulnerability"


"$$" can be thought of as "and then."  You are telling the game, "Say 'I am invincible!' and then trigger the Temporary Invulnerability power."  The game will do just that, in that order, though it will happen so quickly it will appear to occur simultaneously.
"$$" can be thought of as "and then."  You are telling the game, "Say 'I am invincible!' and then trigger the Temporary Invulnerability power."  The game will do just that, in that order, though it will happen so quickly it will appear to occur simultaneously.
Line 181: Line 181:
You could do this with just about any power you want.  A popular keybind is to add a message to the [[Super Strength#Taunt|Taunt]] power, such as:
You could do this with just about any power you want.  A popular keybind is to add a message to the [[Super Strength#Taunt|Taunt]] power, such as:


: /bind T "local C'mere, ya pansy! Who wants some?$$pow_exec_name Taunt"
: {{slashcommand|bind}} T "local C'mere, ya pansy! Who wants some?$$pow_exec_name Taunt"


You can even do this to trigger more than one power with the same key:
You can even do this to trigger more than one power with the same key:


: /bind e "pow_exec_name Temp Invulnerability$$pow_exec_name Hover"
: {{slashcommand|bind}} e "pow_exec_name Temp Invulnerability$$pow_exec_name Hover"


This turns on the the Temporary Invulnerability power and then turns on the [[Flight#Hover|Hover]] power.  (Unless Hover is already on, in which case it turns Hover off.)
This turns on the the Temporary Invulnerability power and then turns on the [[Flight#Hover|Hover]] power.  (Unless Hover is already on, in which case it turns Hover off.)
Line 192: Line 192:


Spaces should be omitted between the commands that appear before and after the $$ symbols.  All of the examples in this guide adhere to that standard, but sometimes binds will be seen by developers who have used spaces on either or both sides of the $$ symbols.  Placing a space between $$ and your commands can cause things to break.  For example:
Spaces should be omitted between the commands that appear before and after the $$ symbols.  All of the examples in this guide adhere to that standard, but sometimes binds will be seen by developers who have used spaces on either or both sides of the $$ symbols.  Placing a space between $$ and your commands can cause things to break.  For example:
{{slashcommand|bind}} H "pow_exec_name Healing Aura $$ local You are healed!"


/bind H "pow_exec_name Healing Aura $$ local You are healed!"
Will not work.  Why?  Because the {{slashcommand|bind}} command is not being read as "execute 'Healing Aura'," it is being read as "execute 'Healing Aura '," with a space after the word Aura.  Since there is no such power as Healing-space-Aura-space, nothing happens.
 
Will not work.  Why?  Because the /bind command is not being read as "execute 'Healing Aura'," it is being read as "execute 'Healing Aura '," with a space after the word Aura.  Since there is no such power as Healing-space-Aura-space, nothing happens.


Strangely enough, you CAN use:
Strangely enough, you CAN use:


: /bind h "local You are healed! $$ powexec_name Healing Aura"
: {{slashcommand|bind}} h "local You are healed! $$ powexec_name Healing Aura"


And it will work.  This is because the first command is a text message, and City of Heroes doesn't care if a text message ends in an exclamation point or a space.
And it will work.  This is because the first command is a text message, and City of Heroes doesn't care if a text message ends in an exclamation point or a space.
Line 209: Line 208:
The one thing you cannot do when you bind multiple actions to the same key is set up a macro that will execute one attack, then a second attack, then a third attack, and so on.  If you tried to do the following:
The one thing you cannot do when you bind multiple actions to the same key is set up a macro that will execute one attack, then a second attack, then a third attack, and so on.  If you tried to do the following:


" /bind 1 "pow_exec_name Punch$$pow_exec_name Jab$$pow_exec_name Haymaker"
" {{slashcommand|bind}} 1 "pow_exec_name Punch$$pow_exec_name Jab$$pow_exec_name Haymaker"


The game would immediately try to set up Punch, an instant later be told to execute a Jab instead, and finally be overridden a second time and be told to perform a Haymaker.  The only action it would perform is the Haymaker.
The game would immediately try to set up Punch, an instant later be told to execute a Jab instead, and finally be overridden a second time and be told to perform a Haymaker.  The only action it would perform is the Haymaker.
Line 215: Line 214:
There is an interesting trick you can use to get around this to an extent covered in the [[#Neat Things You Can Do with /Bind|Neat Things You Can Do with /Bind]] section.
There is an interesting trick you can use to get around this to an extent covered in the [[#Neat Things You Can Do with /Bind|Neat Things You Can Do with /Bind]] section.


== Using Variables in /Bind ==
== Using [[Variables]] in {{slashcommand|Bind}} ==


Sometimes you will want to create a binding that will require the use of information that you will not necessarily have at the moment.  You may not have it because you do not know it, or because that information changes, or because that information will be different depending on which character you are playing (and you want a common set of key bindings for all your characters).  City of Heroes currently supports six variables that you can use as placeholders that will be substituted with the actual information when it is available.
Sometimes you will want to create a binding that will require the use of information that you will not necessarily have at the moment.  You may not have it because you do not know it, or because that information changes, or because that information will be different depending on which character you are playing (and you want a common set of key bindings for all your characters).  City of Heroes currently supports six [[variables]] that you can use as placeholders that will be substituted with the actual information when it is available.


Five of the variables are placeholders for information about your own character:
Five of the variables are placeholders for information about your own character:
Line 227: Line 226:
* $battlecry: your character's battlecry (set in your character's ID screen)
* $battlecry: your character's battlecry (set in your character's ID screen)


It is possible to supply this information yourself, but then the /bind command would be specific to that character only, and if you ever exported the key bindings and imported them into another character you would have redo those /binds.  Besides, your level changes throughout the game.
It is possible to supply this information yourself, but then the {{slashcommand|bind}} command would be specific to that character only, and if you ever exported the key bindings and imported them into another character you would have redo those binds.  Besides, your level changes throughout the game.


With these variables, it is possible to have a /bind command like this:
With these variables, it is possible to have a {{slashcommand|bind}} command like this:


: /bind V "local Hello, I am $name, a level $level $origin $archetype. $battlecry"
: {{slashcommand|bind}} V "local Hello, I am $name, a level $level $origin $archetype. $battlecry"


This bind would cause whichever character you were using at the time to fill in those variables with information specific to their individual builds.  For three different characters, for example, the result may be:
This bind would cause whichever character you were using at the time to fill in those variables with information specific to their individual builds.  For three different characters, for example, the result may be:
Line 248: Line 247:
The last variable is $target, which acts as a placeholder for the name of any other character or object you are currently selecting, whether that is another hero, a civilian, a villain, or any other targetable object.  This variable can be very useful when you want to identify whomever or whatever you have targeted.
The last variable is $target, which acts as a placeholder for the name of any other character or object you are currently selecting, whether that is another hero, a civilian, a villain, or any other targetable object.  This variable can be very useful when you want to identify whomever or whatever you have targeted.


For example, you could create a /bind command that would call out a specific villain whenever your tanker uses taunt:
For example, you could create a {{slashcommand|bind}} command that would call out a specific villain whenever your tanker uses taunt:


: /bind t "local C'mere, $target!$$pow_exec_name Taunt"
: {{slashcommand|bind}} t "local C'mere, $target!$$pow_exec_name Taunt"


If you had selected a Hellion Gunner and selected the T key, your character would say "C'mere, Hellion Gunner!" and activate the Taunt power.
If you had selected a Hellion Gunner and selected the T key, your character would say "C'mere, Hellion Gunner!" and activate the Taunt power.


This can be used in informational ways as well.  For example, a keybind may be set up with the [[Teleportation#Recall Friend|Recall Friend]] power to inform group members when someone is being teleported with the following bind:
This can be used in informational ways as well.  For example, a keybind may be set up with the [[Teleportation#Teleport Target|Teleport Target]] power to inform group members when someone is being teleported with the following bind:


: /bind T "group $target, prepare to be teleported to my location.$$pow_exec_name Recall Friend"
: {{slashcommand|bind}} T "group $target, prepare to be teleported to my location.$$pow_exec_name Teleport Target"


This sends a message across the group (team) channel letting everyone know that a character is about to be teleported to the hero using the power, and then activates the Recall Friend power.  For the  message to be more private, it could have done it this way:
This sends a message across the group (team) channel letting everyone know that a character is about to be teleported to the hero using the power, and then activates the Teleport Target power.  For the  message to be more private, it could have done it this way:


: /bind t "tell $target, Prepare to be teleported to my location.$$pow_exec_name Recall Friend"
: {{slashcommand|bind}} t "tell $target, Prepare to be teleported to my location.$$pow_exec_name Teleport Target"


In this example, the variable $target is actually part of the command.  Remember, /tell needs a character name (followed by a comma) in order to know who to send the message to.
In this example, the variable $target is actually part of the command.  Remember, {{slashcommand|tell}} needs a character name (followed by a comma) in order to know who to send the message to.


== Using /Bind with Your Mouse ==
== Using {{slashcommand|Bind}} with Your Mouse ==


Mouse buttons are triggers just like standard keyboard keys are, so you can assign /bind commands to them in the same manner.
Mouse buttons are triggers just like standard keyboard keys are, so you can assign {{slashcommand|bind}} commands to them in the same manner.


The trigger key names for each of the mouse buttons are listed below:
The trigger key names for each of the mouse buttons are listed below:
Line 272: Line 271:
* LBUTTON:  The left mouse button on a right-handed mouse.  It is usually referred to as "Mouse Button 1" when used in the context of both left and right handed mice.
* LBUTTON:  The left mouse button on a right-handed mouse.  It is usually referred to as "Mouse Button 1" when used in the context of both left and right handed mice.
* RBUTTON:  The right mouse button on a right-handed mouse.  It is usually referred to as "Mouse Button 2" when used in the context of both left and right handed mice.
* RBUTTON:  The right mouse button on a right-handed mouse.  It is usually referred to as "Mouse Button 2" when used in the context of both left and right handed mice.
* MBUTTON:  The button between Mouse Button 1 and Mouse Button 2.  In modern mice it usually doubles as the scroll wheel. It is usually referred to as "Mouse Button 3."
* MBUTTON:  The button between Mouse Button 1 and Mouse Button 2.  In modern mice it usually doubles as the scroll wheel. It is often referred to as "Mouse Button 3."
* BUTTON4
* BUTTON4
* BUTTON5
* BUTTON5
Line 279: Line 278:
* BUTTON8
* BUTTON8


Buttons 4 through 8 are used to describe extra buttons your mouse may have.  At present, it does not seem possible to successfully use button 6, button 7 or button 8 in key bindings, but button 4 and button 5 seem to work just fine.
Buttons 4 through 8 are used to describe extra buttons your mouse may have.  At present, it does not seem possible to successfully use button 6, button 7 or button 8 in key bindings, but button 4 and button 5 seem to work just fine depending on the mouse.


=== LBUTTON/BUTTON 1 ===
=== LBUTTON/BUTTON 1 ===
Line 287: Line 286:
For example:
For example:


: /bind LBUTTON "+forward"
: {{slashcommand|bind}} LBUTTON "+forward"


Does not replace button 1's default functionality with "forward."  Instead, when you press down on button 1, a "click" is triggered ''and'' your character moves forward.  This could have some awkward consequences.  If your mouse was resting over a power icon in the power tray, for example, and you clicked on the button to move forward you would also click on that power.
Does not replace button 1's default functionality with "forward."  Instead, when you press down on button 1, a "click" is triggered ''and'' your character moves forward.  This could have some awkward consequences.  If your mouse was resting over a power icon in the power tray, for example, and you clicked on the button to move forward you would also click on that power.
Line 299: Line 298:
=== MBUTTON/BUTTON 3 ===
=== MBUTTON/BUTTON 3 ===


Button 3 is a weird button.  It seems to be permanently bound to +camrotate, which allows you to rotate the camera around your character.  The command may be overridden for short periods of time, but eventually +camrotate suddenly reattaches itself to mbutton while retaining the functionality of whatever else is bound to it.
Button 3 is bound to +camrotate, which allows you to rotate the camera around your character.  


== Saving and Loading Key Bindings ==
== Saving and Loading Key Bindings ==


If you want to save your keybinds to your hard drive, use the slash command /bind_save.  This saves your keybinds in a file called keybinds.txt in your City of Heroes application directory (C:\Program Files\City of Heroes by default).
If you want to save your custom keybinds to your hard drive, use the slash command {{slashcommand|bind_save}}.  This saves your custom keybinds in a file called keybinds.txt in your City of Heroes [[Default Folder|default folder]]. (C:\Games\Homecoming\Settings\Live by default).
: {{slashcommand|bind_save| }}
: {{slashcommand|bind_save| }}
:: Saves the all current keybinds to keybinds.txt in the install directory.
:: Saves the all current custom keybinds to keybinds.txt in the [[Default Folder|default folder]].
: {{slashcommand|bind_load| }}
: {{slashcommand|bind_load| }}
:: Loads keybinds from the file keybinds.txt in the install directory.
:: Loads custom keybinds from the file keybinds.txt in the [[Default Folder|default folder]].
 
If you want to load the keybinds.txt file, use the slash command {{slashcommand|bind_load}}.  As long as the keybinds.txt file is still in your [[Default Folder|default folder]], it will load automatically.


If you want to load the keybinds.txt file, use the slash command /bind_load.  As long as the keybinds.txt file is still in your City of Heroes application directory, it will load automatically.
If you would like to save '''''all''''' of your currently active keybinds, including both custom and default keybinds, use {{slashcommand|show_bind_all_file|fileName}}.


It is possible to load other text files with bind commands in it simply by specifying the file name and location.  The full command is
It is possible to load other text files with bind commands into the game simply by specifying the file name and location.  The full command is


: {{slashcommand|bind_load_file|full path or relative path}}
: {{slashcommand|bind_load_file|full path or relative path}}
:: ''Full path'' would be the full path to the file, including spaces (if there is a space, the path needs to be in quotes).
:: ''Full path'' would be the full path to the file, including spaces (if there is a space, the path needs to be in quotes).
:: /bind_load_file C:\CoH\textfiles\judge.txt
:: {{slashcommand|bind_load_file}} C:\CoH\textfiles\judge.txt
::: The command would load the judge.txt file from the C:\CoH\textfiles directory.
::: The command would load the judge.txt file from the C:\CoH\textfiles directory.
:: ''Relative path'' would be any file or directory in the '''piggs''' directory.
:: ''Relative path'' would be any file or directory in the [[Default Folder|default folder]].
:: /bind_load_file mybinds.txt
:: {{slashcommand|bind_load_file}} mybinds.txt
::: This would load the file c:\Program Files\City of Heroes\piggs\mybinds.txt.
::: This would load the file c:\Games\Homecoming\Settings\Live\mybinds.txt.
:: /bind_load_file .\binds\otherbinds.txt
:: {{slashcommand|bind_load_file}} \binds\otherbinds.txt
::: This would load the file c:\Program Files\City of Heroes\piggs\binds\otherbinds.txt
::: This would load the file c:\Games\Homecoming\Settings\Live\binds\otherbinds.txt {{slashcommand|bind_save_file}} follows the same rules.
/bind_save_file follows the same rules.
: {{slashcommand|bind_save_file|full path or relative path}}
: {{slashcommand|bind_save_file|full path or relative path}}




When a bind file is loaded using either /bind_load or /bind_load_file, the new file does not replace the old file, it is merged with it.  If a key binding conflicts between the current file and the file being loaded, the binding in the file being loaded is used, but any key binding mentioned in the current file that is not present in the file being loaded is left alone.
When a bind file is loaded using either {{slashcommand|bind_load}} or {{slashcommand|bind_load_file}}, the new file does not replace the old file, it is merged with it.  If a keybinding conflicts between the current file and the file being loaded, the binding in the file being loaded is used, but any key binding mentioned in the current file that is not present in the file being loaded is left alone.


Thus you can use /bind_load_file to load a keybinds file that has only two entries in it, and only those two entries will be changed.  This is useful in the toggle key bindings section of the [[#Neat Things You Can Do with /Bind|Neat Things You Can Do with /Bind]] section.
Thus you can use {{slashcommand|bind_load_file}} to load a keybinds file that has only two entries in it, and only those two entries will be changed.  This is useful in the toggle key bindings section of the [[#Neat Things You Can Do with /Bind|Neat Things You Can Do with /Bind]] section.


=== Understanding Keybinds.txt ===
=== Understanding Keybinds.txt ===


The keybinds.txt file is the file that is created when you use the /bind_save slash command.  It contains a list of all the triggers and commands you have defined for the character you saved it from.
The keybinds.txt file is the file that is created when you use the {{slashcommand|bind_save}} slash command.  It contains a list of all the custom triggers and commands you have defined for the character you saved it from.


This is a sample of what keybinds.txt looks like:
This is a sample of what keybinds.txt looks like:
Line 344: Line 344:
  RIGHT "+turnright"
  RIGHT "+turnright"


Notice the /bind command is not used at all.  All you see is the trigger and the command.  If you want to make custom keybind files that can be loaded with the slash command /bind_load_file, you need to follow this format.  Use the /bind command in the chat window, not in the keybinds.txt file.
Notice the {{slashcommand|bind}} command is not used at all.  All you see is the trigger and the command.  If you want to make custom keybind files that can be loaded with the slash command {{slashcommand|bind_load_file}}, you need to follow this format.  Use the {{slashcommand|bind}} command initially in the chat window, not in the keybinds.txt file.
 
== Using "Rotating Binds" ==


/Bind is designed to tie a specific command to a specific key.  The command might be fairly elaborate, involving an action, speech, a remapping of auto-attack, and a few combinations of slash commands, but each time you press the key it always invokes the same command.  "One key, one command" is the way /bind was intended to work.
== Using "Rotating Text Binds" ==
{{slashcommand|Bind}} is designed to tie a specific command to a specific key.  The command might be fairly elaborate, involving an action, speech, a remapping of auto-attack, and a few combinations of slash commands, but each time you press the key it always invokes the same command.  "One key, one command" is the way {{slashcommand|bind}} was intended to work.


There is, however, a way around this.
There is, however, a way around this.
Line 362: Line 361:
These taunts will add a little variety to your character's taunting power, and because it is not the same thing over and over again, it may be a little tolerable for your teammates.
These taunts will add a little variety to your character's taunting power, and because it is not the same thing over and over again, it may be a little tolerable for your teammates.


Now, you could go ahead and bind each taunt with your taunt power to a different key, but that would be wasteful.  Wouldn't it be more convenient if you hit one taunt key, and each time you did so it called up a different taunt?  It is possible to configure a key to rotate through a set of different key bindings, but it is a little complicated.  The way you do this is by constantly replacing your current key binding with a new one using the command /bind_load_file
Now, you could go ahead and bind each taunt with your taunt power to a different key, but that would be wasteful.  Wouldn't it be more convenient if you hit one taunt key, and each time you did so it called up a different taunt?  It is possible to configure a key to rotate through a set of different key bindings, but it is a little complicated.  The way you do this is by constantly replacing your current key binding with a new one using the command {{slashcommand|bind_load_file}}


=== A Brief Tangent:  A Recap of /Bind_load_file ===
=== A Brief Tangent:  A Recap of {{slashcommand|Bind_load_file}} ===


The /bind_load slash command tells City of Heroes to load the keybinds.txt file in your City of Heroes application directory.  The /bind_load_file slash command allows you to specify the name and location of the keybind file you want to load.  Thus, if the following commands are used:
The {{slashcommand|bind_load}} slash command tells City of Heroes to load the keybinds.txt file in your City of Heroes application directory.  The {{slashcommand|bind_load_file}} slash command allows you to specify the name and location of the [[bindfile]] you want to load.  Thus, if the following commands are used:


: /bind_load_file C:\keybinds\curveball.txt
: {{slashcommand|bind_load_file}} C:\keybinds\curveball.txt
: /bind_load_file C:\keybinds\stormhaven.txt
: {{slashcommand|bind_load_file}} C:\keybinds\stormhaven.txt
: /bind_load_file C:\keybinds\judge.txt
: {{slashcommand|bind_load_file}} C:\keybinds\judge.txt


The game would go into your c:\keybinds directory and load whatever file name specified.
The game would go into your c:\keybinds directory and load whatever file name specified.


The curveball.txt, stormhaven.txt and judge.txt files might have a few commands specific to those characters.  For example, Stormhaven is a storm/electric defender, and the key used to bring up his hurricane power might be the same key used to bring up Curveball's teleport foe power.  When a new character is created, /bind_load may be used to bring in my basic command set, and then /bind_load_file c:\keybinds\curveball.txt (or stormhaven.txt, or judge.txt) might be used to bring in character-specific key bindings.
The curveball.txt, stormhaven.txt and judge.txt files might have a few commands specific to those characters.  For example, Stormhaven is a storm/electric defender, and the key used to bring up his hurricane power might be the same key used to bring up Curveball's teleport foe power.  When a new character is created, {{slashcommand|bind_load}} may be used to bring in my basic command set, and then {{slashcommand|bind_load_file}} c:\keybinds\curveball.txt (or stormhaven.txt, or judge.txt) might be used to bring in character-specific key bindings.


And because these files only require a few deviations from the default keybinds.txt file, only a few commands are needed in each:
And because these files only require a few deviations from the custom keybinds.txt file, only a few commands are needed in each:


'''curveball.txt'''
'''curveball.txt'''
Line 402: Line 401:
  T "powexec_name Combat Jumping"
  T "powexec_name Combat Jumping"


Each of these files only import five keybinds.  Some of those keybinds are simply commands that overwrite what was originally there and replace it with nothing (nop) and others are specific powers.
Each of these files only import five keybinds.  Some of those keybinds are simply commands that overwrite what was originally there and replace it with nothing ([[slashcommand|nop}}) and others are specific powers.


If wanted, in the default keybinds.txt, Commands may be created that automatically loaded these:
If wanted, in the default keybinds.txt, Commands may be created that automatically loaded these:
Line 412: Line 411:
By pressing the numbers 1, 2, and 3 on the number keypad, a custom bind set can be loaded.
By pressing the numbers 1, 2, and 3 on the number keypad, a custom bind set can be loaded.


=== Back on Course: Creating a Rotating Bind ===
=== Back on Course: Creating a Rotating Text Bind ===


To set up a key that rotates between the five taunts listed earlier in this section, you need to create custom keybind files for each of them.  These keybind files need to contain three things:
To set up a key that rotates between the five taunts listed earlier in this section, you need to create custom keybind files for each of them.  These keybind files need to contain three things:
Line 420: Line 419:
* the command to load the next taunt binding
* the command to load the next taunt binding


The first thing you need to do is to create five keybind files: taunt1.txt, taunt2.txt, taunt3.txt, taunt4.txt, and taunt5.txt.  In each taunt file, you need to put in the /bind command that gets executed.  So each file would look like this:
The first thing you need to do is to create five keybind files: taunt1.txt, taunt2.txt, taunt3.txt, taunt4.txt, and taunt5.txt.  In each taunt file, you need to put in the {{slashcommand|bind}} command that gets executed.  So each file would look like this:


'''taunt1.txt'''
'''taunt1.txt'''
Line 450: Line 449:
  T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"
  T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"


When you use the slash command /bind_load, then T will be bound to emulate the taunt5.txt binding, and the first taunt binding will activate the next time T is pressed.
When you use the slash command {{slashcommand|bind_load}}, then T will be bound to emulate the taunt5.txt binding, and the first taunt binding will activate the next time T is pressed.


As long as you are willing to be patient and set up your files before you get into the game, you can create rotating binds for just about everything.  For example, rotating binds may be created for your mouse so that pressing a key loads one set of binds to the mouse to put it in "movement mode" and pressing it again loads another set of binds to put it in "default mode".
As long as you are willing to be patient and set up your files before you get into the game, you can create rotating text binds for just about everything.  For example, rotating text binds may be created for your mouse so that pressing a key loads one set of binds to the mouse to put it in "movement mode" and pressing it again loads another set of binds to put it in "default mode".


=== Macros ===
== Macros ==


What do you do when you run out of keys to bind?  Create icons.
What do you do when you run out of keys to bind?  Create icons.
Line 462: Line 461:
So why are there nine trays?  Why, so you can create your own icons, of course!
So why are there nine trays?  Why, so you can create your own icons, of course!


In City of Heroes it is possible to create your own icons on the power bar.  These icons can be activated with a mouse click, or can even be bound to keys if you use the /pow_exec_tray slash command to identify which tray and which slot in that tray the icon is sitting.  You do this by using the /macro command.
In City of Heroes it is possible to create your own buttons on the power bar.  These icons can be activated with a mouse click, or can even be bound to keys if you use the [[Powexec_tray (Slash Command)|/pow_exec_tray]] slash command to identify which tray and which slot in that tray the icon is sitting.  You do this by using the {{slashcommand|macro}} command.
 
{{slashcommand|Macro}} is very similar to {{slashcommand|bind}}.  You are, in effect, binding a command to an object.  The main difference is that {{slashcommand|bind}} uses objects that already exist (keys on your keyboard) as the trigger, whereas {{slashcommand|macro}} creates the trigger and then associates the command to it.  The trigger it creates is a new icon that sits on the first empty slot on your power bar.
/Macro is very similar to /bind.  You are, in effect, binding a command to an object.  The main difference is that /bind uses objects that already exist (keys on your keyboard) as the trigger, whereas /macro creates the trigger and then associates the command to it.  The trigger it creates is a new icon that sits on the first empty slot on your power bar.


The basic format for /macro is:
The basic format for {{slashcommand|macro}} is:


: {{slashcommand|macro|macroname "command(s)"}}
: {{slashcommand|macro|macroName "command(s)"}}


It is possible to do anything with /macro that you can do with /bind.  The only major difference is that instead of pressing a key to trigger the command, you click on the macro icon sitting in the power bar.  You can also use any key bindings associated with the slot it is sitting in (for example, if it were in the second slot on the first tray of the power bar, you could press the 2 key to activate the macro) but you cannot bind a key directly to the macro itself.
It is possible to do anything with {{slashcommand|macro}} that you can do with {{slashcommand|bind}}.  The only major difference is that instead of pressing a key to trigger the command, you click on the macro icon sitting in the power bar.  You can also use any key bindings associated with the slot it is sitting in (for example, if it were in the second slot on the first tray of the power bar, you could press the 2 key to activate the macro) but you cannot bind a key directly to the macro itself.


People are often confused by /macro because it is so similar to /bind.  Here is an example of macro creation to put the entire thing in context.
People are often confused by {{slashcommand|macro}} because it is so similar to {{slashcommand|bind}}.  Here is an example of macro creation to put the entire thing in context.


Let's say you want your character to have an emote/speech combination:  You want him to perform the ThumbsUp emote and say "Good work!"  But you don't want to devote a key to it—you need your keys for combat and navigation controls—but you decide it would be okay if you could just click on an icon in the power tray to perform that function.
Let's say you want your character to have an emote/speech combination:  You want him to perform the ThumbsUp emote and say "Good work!"  But you don't want to devote a key to it — you need your keys for combat and navigation controls — but you decide it would be okay if you could just click on an icon in the power tray to perform that function.


The /bind command would be for this:
The {{slashcommand|bind}} command would be for this:


: /bind [some key] "em ThumbsUp$$local Good Work!"
: {{slashcommand|bind}} [some key] "em ThumbsUp$$local Good Work!"


For /macro, [some key] is replaced by whatever name you want to give the macro:
For {{slashcommand|macro}}, [some key] is replaced by whatever name you want to give the macro:


: /macro GW "em ThumbsUp$$local Good Work!"
: {{slashcommand|macro}} GW "em ThumbsUp$$local Good Work!"


Typing that in the command window will cause a new icon to appear in the first empty slot on the first available tray on your Power Bar with the letters "GW" stamped on it.  You can now move that icon anywhere I want to on my tray, and clicking on it will cause your character to stick his thumb up in the air and say "Good Work!"
Typing that in the command window will cause a new icon to appear in the first empty slot on the first available tray on your Power Bar with the letters "GW" stamped on it.  You can now move that icon anywhere I want to on my tray, and clicking on it will cause your character to stick his thumb up in the air and say "Good Work!"
Line 488: Line 486:
You can name your macro anything you like, but the icon has limited space to actually display the letters.  You will probably want to try to keep your macros down to one- or two-letter names so they can be read clearly on the icon tray.
You can name your macro anything you like, but the icon has limited space to actually display the letters.  You will probably want to try to keep your macros down to one- or two-letter names so they can be read clearly on the icon tray.


That is the /macro command in a nutshell.  Really, that's all there is to it.  /Macro seems tricky because it is almost identical /bind, and the "almost" throws people.  The only difference between the two is that /macro creates the object that triggers the command, and you need to tell the game what the object is named.
That is the {{slashcommand|macro}} command in a nutshell.  Really, that's all there is to it.  {{slashcommand|Macro}} seems tricky because it is almost identical {{slashcommand|bind}}, and the "almost" throws people.  The primary difference between the two is that {{slashcommand|macro}} creates the object that triggers the command, and you need to tell the game what the object is named.
 
=== Saving Macros ===
 
Macros and their commands can be saved in a file, but there is no slash command to save the macros while in game. Instead you would need to type the macros into a text file manually, making sure that a double dollar sign ($$) is at the beginning of each macro command string. All the macros in the text file can then be automatically loaded into your character at once by using the {{slashcommand|bind_load_file}} command. For example:
 
A sample text file holding macros might look like this:
 
'''myMacros.txt'''
$$macro Hi "emote wave"
$$macro Yes "emote thumbsup"
$$macro Dance "emote dance"
 
Then, to load the macros into your character, type:
/bind_load_file myMacros.txt
 
===Rotating Text Macros===
 
By using macros stored in text files in combination with the {{slashcommand|bind_load_file}} and {{slashcommand|Macroslot}} commands, complex rotating text macros can be created (very similar to rotating text binds). This allows one macro to replace another macro in the same power tray slot. Basically, it lets the same macro button do different things on each click.
 
As with rotating text binds, text files first need to be created with the various bind and macro commands in them. {{slashcommand|bind_load_file}} is used to replace the bind commands, and the {{slashcommand|macroslot}} command is used to replace one macro button with another button containing the commands from the next text file.


== Neat Things You Can Do with /Bind ==
The syntax or format for text macros are exactly like normal binds except a double dollar sign ($$) must appear at the beginning of the command string. The following is an example of a rotating text macro:


This is the section that has samples of some of the fun stuff you can do with the /bind command.
'''mFlyCC0.txt'''
$$macroslot 20 "FlyON" "cc 1$$Powexec_Toggle_On Fly$$Bind_Load_File /binds/mFlyCC1.txt"
'''mFlyCC1.txt'''
$$macroslot 20 "FlyOFF" "cc 0$$Powexec_Toggle_Off Fly$$Bind_Load_File /binds/mFlyCC0.txt"
To enable the rotating text macro, type the commands inside the first text file into the chat box with a slash "/" at the beginning. Then press the Enter key to create the macro button for the first time.
/$$macroslot 20 "FlyON" "cc 1$$Powexec_Toggle_On Fly$$Bind_Load_File /binds/mFlyCC1.txt"
 
When the macro button is clicked, the character's outfit will change to costume #1 and the character will start flying. When the same macro button is clicked again, the character's outfit will change to a different costume (costume #0) and Fly will turn off. Then when the macro button is clicked again, the character will change to costume #1 and start to fly again, and so on.
 
== Neat Things You Can Do with {{slashcommand|Bind}} ==
 
This is the section that has samples of some of the fun stuff you can do with the {{slashcommand|bind}} command.


=== Getting Around the "No Queued Attack" Rule ===
=== Getting Around the "No Queued Attack" Rule ===


We have already learned that you cannot "queue up attacks" with /bind, but there are ways to get around that limitation to an extent.  One of the participants in a "The Day I remapped my mouse with /bind" thread had an ingenious bind that did no less than SEVEN actions.  The last two actions were to attack with two different ranged attacks. The second method was shared with me by the maker of Akai's proc calculator and doesn't execute multiple commands with one click, but instead executes a different attack on each click in a sort of loop.
We have already learned that you cannot "queue up attacks" with {{slashcommand|bind}}, but there are ways to get around that limitation to an extent.  One of the participants in a "The Day I remapped my mouse with {{slashcommand|bind}}" thread had an ingenious bind that did no less than SEVEN actions.  The last two actions were to attack with two different ranged attacks. The second method was shared with me by the maker of Akai's proc calculator and doesn't execute multiple commands with one click, but instead executes a different attack on each click in a sort of loop.


==== Auto attack method ====
==== Auto attack method ====
Line 502: Line 533:
How did he do it?  By not really attacking the first attack.  Instead, he just set it up so that attacking would be the immediate consequence of the command:
How did he do it?  By not really attacking the first attack.  Instead, he just set it up so that attacking would be the immediate consequence of the command:


: /bind NUMPAD0 "pow_exec_auto Dark Blast$$pow_exec_name Moonbeam"
: {{slashcommand|bind}} NUMPAD0 "pow_exec_auto Dark Blast$$pow_exec_name Moonbeam"


This is just the last bit of the original bind, which is much longer.  When the 0 button on the number keypad is pressed, Dark Blast is set up as an automatically fired power.  That is, it will fire at an enemy is selected and within range of the attack.  After Dark Blast is set to auto, Moonbeam is fired.  This is what happens:
This is just the last bit of the original bind, which is much longer.  When the 0 button on the number keypad is pressed, Dark Blast is set up as an automatically fired power.  That is, it will fire at an enemy is selected and within range of the attack.  After Dark Blast is set to auto, Moonbeam is fired.  This is what happens:
Line 512: Line 543:
With this bind, two attacks were set up, but only one is specifically fired off.
With this bind, two attacks were set up, but only one is specifically fired off.


==== Bind chaining method ====
====Rotating Text Bind Method====
 
When a bind is executed, it is parsed from left to right, but powers activate from RIGHT to LEFT in the bind string because multiple powers in a single bind string will interrupt each other as they attempt to activate, leaving the last power in the string (far right) to be the first one to activate unhindered. Taking advantage of this, the user can create a series of binds that each execute an attack first, then load the next bind in a series to the same key. This allows multiple attacks to be bound to the same key and queued in a cyclic order. Here's an example of how to do it:
When a bind is executed, it is parsed from RIGHT to LEFT. Taking advantage of this, the user can create a series of binds that each execute an attack first, then load the next bind in a series to the same key. This allows multiple attacks to be bound to the same key and queued in a cyclic order. Here's an example of how to do it:
* Create a binds directory in the working directory of City of Heroes. In this example it's just called "binds".
* Create a .txt file with the bind you want, omitting the "bind" portion in the file. Will name this file "attack1.txt"
: NUMPAD0 "bind_load_file_silent /binds/attack2.txt$$pow_exec_name Moonbeam"
* Create a second .txt file with the next attack in the series, again omitting the "bind" portion, that is all done by the "bind_load_file_silent" command. This file will be called "attack2.txt"
: NUMPAD0 "bind_load_file_silent /binds/attack1.txt$$pow_exec_name Dark Blast"


Create a binds directory in the working directory of City of Heroes. In this example it's just called "binds".
Create a .txt file with the bind you want, omitting the "bind" portion in the file. Will name this file "attack1.txt"
NUMPAD0 "bind_load_file_silent /binds/attack2.txt$$pow_exec_name Moonbeam"
Create a second .txt file with the next attack in the series, again omitting the "bind" portion, that is all done by the "bind_load_file_silent" command. This file will be called "attack2.txt"
NUMPAD0 "bind_load_file_silent /binds/attack1.txt$$pow_exec_name Dark Blast"
You can see how one file points to the other in a circular chain. Lastly, just set it up in-game by using either of the bind commands
You can see how one file points to the other in a circular chain. Lastly, just set it up in-game by using either of the bind commands
: /bind_load_file_silent /binds/attack1.txt


/bind_load_file_silent /binds/attack1.txt
Each time NUMPAD0 is pressed, it will first execute an attack, then rebind that key to execute the next attack. I saw a Mastermind (@Nexros global) use this method to bind a single key to combine any and all inspirations into reds, then automatically feed them to his pets--all with one key!
Each time NUMPAD0 is pressed, it will first execute an attack, then rebind that key to execute the next attack. I saw a Mastermind (@Nexros global) use this method to bind a single key to combine any and all inspirations into reds, then automatically feed them to his pets--all with one key!
====Splitting One Key Into Two Keys====
The plus (+) and minus (-) symbols can be used as prefixes in front of a bind command string. Adding a prefix to the beginning of a bind command string tells the game to execute the command(s) on key ''press'', and again on key ''release''. For example, suppose we bind the following to the "K" key:
+$$sprint
When the K key is pressed down the power Sprint will turn on. As long as the key is pressed and held down, Sprint will continue to stay on. When the key is released, Sprint will toggle off because the Sprint command was executed again.
If used in combination with {{slashcommand|bind_load_file}} and rotating text binds, this can effectively split one key into two, and allows us to bind 2 completely different bind command strings to a single key... one on key press, and the other on key release. For example:
'''KeyPress.txt'''
K "+$$Sprint$$bind_load_file KeyRelease.txt"
'''KeyRelease.txt'''
K "+$$Athletic Run$$bind_load_file KeyPress.txt"
This will activate Sprint when the K key is pressed, and then activate Athletic Run when the key is released.


=== Targeting the Nearest Enemy ===
=== Targeting the Nearest Enemy ===


The tab key is nice for quickly moving from enemy target to enemy target, but how do you quickly attack the closest enemy to you?  It's easy.  First you tell the game to target no one at all, then you tell to to target an enemy.  It will always choose the closest one to you:
The tab key is nice for quickly moving from enemy target to enemy target, but how do you quickly attack the closest enemy to you?  It's easy.  First you tell the game to target no one at all, then you tell it to target an enemy.  It will always choose the closest one to you:


: /bind space "target_enemy_near"
: {{slashcommand|bind}} space "target_enemy_near"


When you press the space bar, the game will drop any target you currently have and then target the closest enemy.
When you press the space bar, the game will drop any target you currently have and then target the closest enemy.
Line 538: Line 582:
If you are not satisfied using your keyboard to control all your movement, you can bind navigation and movement keys to your mouse buttons to give you greater mouse control.  The following examples assume you have a four button mouse:
If you are not satisfied using your keyboard to control all your movement, you can bind navigation and movement keys to your mouse buttons to give you greater mouse control.  The following examples assume you have a four button mouse:


: /bind RBUTTON "+forward$$+mouse_look"
: {{slashcommand|bind}} RBUTTON "+forward$$+mouse_look"
: /bind LBUTTON "-mouse_look"
: {{slashcommand|bind}} LBUTTON "-mouse_look"
: /bind MBUTTON "map"
: {{slashcommand|bind}} MBUTTON "map"
: /bind BUTTON4 "+up"
: {{slashcommand|bind}} BUTTON4 "+up"
: /bind LSHIFT+RBUTTON "+backward$$+mouse_look"
: {{slashcommand|bind}} LSHIFT+RBUTTON "+backward$$+mouse_look"
: /bind LALT+RBUTTON "-mouse_look"
: {{slashcommand|bind}} LALT+RBUTTON "-mouse_look"


The first button is the basic navigation command.  When you click mouse button 2, the mouse enters "mouse look" mode.  The mouse pointer disappears when you move the mouse to the left or right, your character turns left or right.  When you move your mouse up or down, your character looks up or down (and if flying, your character tilts up or down).  Now every time you press down on mouse button 2 your character will move forward.
The first button is the basic navigation command.  When you click mouse button 2, the mouse enters "mouse look" mode.  The mouse pointer disappears when you move the mouse to the left or right, your character turns left or right.  When you move your mouse up or down, your character looks up or down (and if flying, your character tilts up or down).  Now every time you press down on mouse button 2 your character will move forward.
Line 549: Line 593:
The second binding ends mouse look.  When you actually need to use your mouse to click on something, click on mouse button 1 and your pointer will reappear.
The second binding ends mouse look.  When you actually need to use your mouse to click on something, click on mouse button 1 and your pointer will reappear.


The third mouse binding causes the zone map to pop up whenever you press mouse button 3.  Mouse button 3 will probably continue to stay mapped to +camrotate, so you can still use it rotate the camera around your character.  It is alternately annoying and amusing to see one happen when you are only interested in the other.
The third mouse binding causes the zone map to pop up whenever you press mouse button 3.  


The fourth mouse binding allows mouse button 4 to control when the character jumps.
The fourth mouse binding allows mouse button 4 to control when the character jumps.
Line 574: Line 618:


One could also bind them in separate commands using:  
One could also bind them in separate commands using:  
: /bind numpad1 "teamselect 1"
: {{slashcommand|bind}} numpad1 "teamselect 1"
: /bind numpad2 "teamselect 2"  
: {{slashcommand|bind}} numpad2 "teamselect 2"  
: ...
: ...


Players can then customize other number pad keys to use buffs.  For instance, on characters that have Kinetics, one can use:  
Players can then customize other number pad keys to use buffs.  For instance, on characters that have Kinetics, one can use:  
: /bind add "powexec_name Increase Density"
: {{slashcommand|bind}} add "powexec_name Increase Density"
: /bind numpadenter "powexec_name Speed Boost"
: {{slashcommand|bind}} numpadenter "powexec_name Speed Boost"
This makes it easy to buff any single teammate or the whole team in succession.  
This makes it easy to buff any single teammate or the whole team in succession.  


Line 586: Line 630:


For a complete list of key names, see [[List of Key Names]].
For a complete list of key names, see [[List of Key Names]].


== Source ==
== Source ==


The original text of this article was derived from [http://web.archive.org/web/20080220072924/http://boards.cityofheroes.com/showflat.php?Number=371472 The Incomplete and Unofficial Guide to /bind (1.1)] by Curveball.
The original text of this article was derived from [http://web.archive.org/web/20080220072924/http://boards.cityofheroes.com/showflat.php?Number=371472 The Incomplete and Unofficial Guide to {{slashcommand|bind}} (1.1)] by Curveball.
 
 


{{Navbox Binds}}
{{Navbox Binds}}


[[Category:Player Guides (Commands and Binds)]]
[[Category:Player Guides (Commands and Binds)]]

Latest revision as of 07:34, 18 November 2024

Introduction

Welcome to The Incomplete and Unofficial Guide to /bind, an attempt to collect all the information we know about the bind command and organize it in a way that will make using it a lot easier to understand. Bind is a very powerful tool for customizing the way you play your game, and while it is a little confusing to use when you first get into it, it gets easier the more you play with it.

This guide will (hopefully) make it easier for you to:

  • Understand what the /bind command does
  • Get a solid grasp on how it works, so you can play around with it on your own, and
  • Immediately start using /bind to remap your keyboard and mouse in ways that the basic options in-game will now allow

Understanding What /Bind Is

City of Heroes comes with a set of predefined or default in-game navigation and control commands. Pressing the W key moves your character forward, pressing the A key rotates your character to the left, pressing the D key rotates your character to the right, and so on. If you are not happy with these commands, you can open up the options panel, press the Keymapping tab, and replace some of them with key strokes or mouse button clicks of your own choosing. But you cannot do this with every single action in the game. If you want more control over how the in-game commands are assigned to keys, you must use /bind.

In its simplest form, /bind tells the game, "From now on, when this button is pressed, I want you to trigger that action." That action could be anything—start a power, bring up a user interface panel, send a message to another player, and so on. It is even possible to assign multiple actions to the same bind, though there are limits, and the more complex your /bind, the greater a chance that something unexpected (and perhaps unwanted) will happen. That button can be almost any button on your keyboard or mouse, though again there are some limits. Essentially, /bind is telling the game that when you press the F key you want to activate the Hover power. Binds that players create are Custom Keybinds.

What /Bind Is Not

/bind is not a macro language, and it cannot be used to automate your actions.  In some games it is popular to write macros or shortcuts that allow you to queue up a number of attacks.  For example, to start out with Jab, then Punch, then Haymaker, and then to repeat until you no longer have a target.  This is not possible using /bind, though it is possible to do some interesting things with it that come close.

There are in fact "macros" in the game, but they are different than macros in other games. Macros will also be covered at the end of this guide, since they share many similarities to /bind (and enough differences to make them important).

Using /Bind: The Basics

Before you can understand how to use /bind properly, you need to know how to use slash commands. Slash commands are commands that you send to the game while using the chat window. /Bind is a slash command, so understanding how they work in general will help you understand how to use /bind specifically.

Tangent: A Brief Guide to Slash Commands

While you are in-game, press your ENTER key. You will see a flashing prompt in your chat window. You have probably used this any number of times to say something to other players in game, either through the local, team, broadcast or query channels. You may also know that if you append certain words to a slash ("/"), they will be interpreted as in-game commands. For example, if you have ever fallen through the city and find yourself standing in the middle of a big blue void, with the ghostly image of the city hanging above your head, you might press the ENTER key and type

/stuck

And voila! You reappear at the entrance to the zone you were just in. City of Heroes saw the slash in front of "stuck" and realized that you were sending it a command. It then looked up "stuck" and saw that it needed to return you to the proper zone, and *poof*—it was done.

Any time you put a slash in front of text in your chat window, City of Heroes interprets the word that follows as though it were a command, whether the command exists or not. For example, /g tells City of Heroes that all of the text following the "g" should be sent to the group channel (or the team channel).

So if you type:

/g I'd really like a ham sandwich.

Anyone in my team would see the following message:

I'd really like a ham sandwich.

Some commands are a little more complicated. Not only will the game need to know the general command to tell it what to do, it will need a few pointers to show it how or where to do it. For example, /t or /tell informs the game that you want to send a single character on the server a private message. But which character?

The proper way to send a tell is to type the following:

/t character name, Hey! Want to group?

character name in this case represents someone's actual name. So what you have to do is use the /t command, then enter the character's name, then use a comma to separate the instructions from the message, then type the message. So:

/t Curveball, Hey! Want to group?

Would cause the message "Hey! Want to group?" to show up in Curveball's text window.

All this really means is that when you are using a complicated slash command, you often have to be very specific in telling City of Heroes what you want to happen, and that often you have to give it that information in a very specific way. For example, if you typed

/t Curveball Hey! Want to group?

City of Heroes wouldn't know what to do. For all it knows, the character you are trying to send a message to is named "Curveball Hey! Want to group?" which is impossible, since the name field is not long enough and does not allow exclamation points or question marks. The comma after the name is very, very important, because it tells the game "I have told you who to send the message to, now I am going to tell you the message."

Slash commands may optionally have underscores in them. Any underscores in a slash command are ignored by City of Heroes. This feature is handy for commands that are composed of multiple words to make the command more clear. For example, all of the following commands are functionally equivalent:

/powexecname Temp Invulnerability
/pow_exec_name Temp Invulnerability
/_p_o_w_e_x_e_c_n_a_m_e_ Temp Invulnerability

But the second version is arguably the most clear and readable. In binds, no underscores are typically used so that more characters may be used in the command's parameters. However, underscores are used in some game documentation and in keybind files (covered in a later section) and in this guide.

Bringing the Tangent Back On-Topic

That is all well and good, you ask, but what does that have to do with /bind? Well, two things:

  • First, /bind is a slash command, and you need to know how slash commands work in general.
  • Second, /bind is a slash command that can trigger other slash commands.

Format of the /Bind Command

/Bind, like /t or /tell, requires that you format your command very specifically.  The basic layout of a properly constructed /bind command is:
/bind trigger "command"

First you identify the slash command (/bind), then you identify what key will start the command (trigger), and then you place quotes around what the /bind actually does (command).

Of course, none of that makes any sense unless you know what a trigger is and what a command is.

Triggers

A trigger is either a:

  • single key
  • combination of keys
  • mouse click,
  • key and mouse click combination,
  • game controller/joystick button, or
  • combination of game controller buttons

A trigger activates the /bind command. It can be pressing the E key, or clicking mouse button 1, or pressing the left shift key in combination with either the E or mouse button 1. Combinations of keys and mouse buttons allow you to map a lot of very specific commands to a limited number of keys, provided you can keep track of all of them.

Each key has a name that /bind uses to differentiate it from other keys. The majority of the names are pretty easy to figure out. For example, the E key is "E", and the F1 key is "F1." But because some keys on your keyboard share the same name, City of Heroes has assigned them unique, more complex names to set them apart. For example:

  • LSHIFT: the shift key on the left side of your keyboard
  • RSHIFT: the shift key on the right side of your keyboard
  • NUMPAD1: the "1" key on your number pad (as opposed to the row of numbers at the top of your keyboard)
  • LBUTTON: the left mouse button on a right-handed mouse (more commonly known as mouse button 1)
  • MBUTTON: the middle button on a three-button mouse (more commonly known as mouse button 3, often the scroll wheel on modern mice)
  • BUTTON4: usually the thumb button on modern mice

Some special keys called chord keys can be used in combination with other keys and mouse buttons. They do not act as triggers themselves, but can be used with trigger keys to make new triggers.

For example, suppose you have set up the E key to trigger your Tanker's Temp Invulnerability power. In this case, E is a trigger; when you press it, it causes the power to activate. So the /bind command might look like this:

/bind e "power activation command"

(The specifics of the command are not important at the moment. It will be dealt with in the next section. )

The E key is very convenient to access in combat, and if you want you can combine it with a chord key in order assign another command to it. So you could have something like:

/bind LSHIFT+E "another power activation command"

which would tell the game "when the left shift chord key key is pressed, and then (while the left shift key is still pressed down) the E trigger key is pressed, execute the following command."

In the first example, pressing the E key allows you to trigger a power. In the second example, pressing the left shift key and E key together allows you to trigger another power entirely—the shift key is essentially making the E key a completely new trigger.

When you are setting up a chord key and trigger key combination, separate them with the "+" symbol. This tells the game that you are using both keys together. /Bind commands are read from left to right, so if you are using chords in a trigger you must always use the chord key first. If you typed:

/bind e+lshift "another power activation command"

The game would read it as:

/bind e "another power activation command"

and overwrite your original e binding. It does this because e is a trigger key and cannot chord, so it sees "oh, there's an E, I can't do anything else" and skips right to the command in quotation marks.

For a complete list of keys and buttons available for players to use with /bind, see List of Key Names.

Commands

Commands are the instructions the game follows when a trigger is used. When talking about binds, commands are usually other slash commands. In fact, most of the time when you create a /bind, you are assigning a slash command to a key or button.

But what are these commands? There are a lot of them, and they can be found in these two locations:

Putting it all together

Now that you know what triggers are, what types of things those triggers can make happen, let's look at a simple /bind command:

/bind E "pow_exec_name Temp Invulnerability"

This tells the game that whenever the e key is pressed, the power "Temp Invulnerability" should activate.

Pow_exec_name is a slash command. To activate Temporary Invulnerability in your chat window, you would type:

/pow_exec_name Temp Invulnerability

And the power would trigger (assuming you had it). By binding that command to the E key, you save a lot of time, especially in combat.

One of the things you will notice in the /bind example is that in the /bind, the slash command was called without the actual "/." /Bind assumes that you are going to send it a slash command, so the slash is unnecessary, and if you use the slash it will not work.

Correcting mistakes

/unbind key

/unbind key entirely removes the custom binding on "key" and restores its default behaviour.

/unbind_all  

/unbind_all removes all custom bindings from all triggers and restores the game's default keybindings for the currently selected Keybind Profile.

Binding Multiple Commands to the Same Key

The previous example was the simplest form of a /bind command: a key triggered a single action. Sometimes you might want to do something a little more complicated, to set up a bind so that when a single key is pressed, multiple things happen simultaneously.

In keeping with our previous example, let's say that when the Temporary Invulnerability power is triggered you want to have your character say "I am invincible!" Well, that action is actually two slash commands:

To do this, you need a way to tell /bind, "But wait, I want you to do something else." You do this by inserting "$$" between the two commands:

/bind E "local I am invincible!$$pow_exec_name Temp Invulnerability"

"$$" can be thought of as "and then." You are telling the game, "Say 'I am invincible!' and then trigger the Temporary Invulnerability power." The game will do just that, in that order, though it will happen so quickly it will appear to occur simultaneously.

You could do this with just about any power you want. A popular keybind is to add a message to the Taunt power, such as:

/bind T "local C'mere, ya pansy! Who wants some?$$pow_exec_name Taunt"

You can even do this to trigger more than one power with the same key:

/bind e "pow_exec_name Temp Invulnerability$$pow_exec_name Hover"

This turns on the the Temporary Invulnerability power and then turns on the Hover power. (Unless Hover is already on, in which case it turns Hover off.)

Things to Consider When Using $$

Spaces should be omitted between the commands that appear before and after the $$ symbols. All of the examples in this guide adhere to that standard, but sometimes binds will be seen by developers who have used spaces on either or both sides of the $$ symbols. Placing a space between $$ and your commands can cause things to break. For example:

/bind H "pow_exec_name Healing Aura $$ local You are healed!"

Will not work. Why? Because the /bind command is not being read as "execute 'Healing Aura'," it is being read as "execute 'Healing Aura '," with a space after the word Aura. Since there is no such power as Healing-space-Aura-space, nothing happens.

Strangely enough, you CAN use:

/bind h "local You are healed! $$ powexec_name Healing Aura"

And it will work. This is because the first command is a text message, and City of Heroes doesn't care if a text message ends in an exclamation point or a space.

Nevertheless, in general, no spaces at all should be between your first command, the $$, and the second command, and third command, and fourth command, etc.

What You Cannot Do with Multiple Actions

The one thing you cannot do when you bind multiple actions to the same key is set up a macro that will execute one attack, then a second attack, then a third attack, and so on. If you tried to do the following:

" /bind 1 "pow_exec_name Punch$$pow_exec_name Jab$$pow_exec_name Haymaker"

The game would immediately try to set up Punch, an instant later be told to execute a Jab instead, and finally be overridden a second time and be told to perform a Haymaker. The only action it would perform is the Haymaker.

There is an interesting trick you can use to get around this to an extent covered in the Neat Things You Can Do with /Bind section.

Using Variables in /Bind

Sometimes you will want to create a binding that will require the use of information that you will not necessarily have at the moment. You may not have it because you do not know it, or because that information changes, or because that information will be different depending on which character you are playing (and you want a common set of key bindings for all your characters). City of Heroes currently supports six variables that you can use as placeholders that will be substituted with the actual information when it is available.

Five of the variables are placeholders for information about your own character:

  • $name: your character's name
  • $origin: your character's origin
  • $archetype: your character's archetype
  • $level: your character's level
  • $battlecry: your character's battlecry (set in your character's ID screen)

It is possible to supply this information yourself, but then the /bind command would be specific to that character only, and if you ever exported the key bindings and imported them into another character you would have redo those binds. Besides, your level changes throughout the game.

With these variables, it is possible to have a /bind command like this:

/bind V "local Hello, I am $name, a level $level $origin $archetype. $battlecry"

This bind would cause whichever character you were using at the time to fill in those variables with information specific to their individual builds. For three different characters, for example, the result may be:

  • Curveball
"Hello, I am Curveball, a level 10 magic defender. You have GOT to be kidding me!"
  • The Judge
"Hello, I am Judge, a level 11 mutant tanker. You are... guilty."
  • Stormhaven
"Hello, I am Stormhaven, a level 12 mutant defender. "

Note that if the battlecry has its own punctuation it will be included in the battlecry string (which is why I did not include any in my bind.) Stormhaven, who has no battlecry, says nothing, but there is still a trailing space between the period at the end of the first sentence and where the battlecry would start.

The last variable is $target, which acts as a placeholder for the name of any other character or object you are currently selecting, whether that is another hero, a civilian, a villain, or any other targetable object. This variable can be very useful when you want to identify whomever or whatever you have targeted.

For example, you could create a /bind command that would call out a specific villain whenever your tanker uses taunt:

/bind t "local C'mere, $target!$$pow_exec_name Taunt"

If you had selected a Hellion Gunner and selected the T key, your character would say "C'mere, Hellion Gunner!" and activate the Taunt power.

This can be used in informational ways as well. For example, a keybind may be set up with the Teleport Target power to inform group members when someone is being teleported with the following bind:

/bind T "group $target, prepare to be teleported to my location.$$pow_exec_name Teleport Target"

This sends a message across the group (team) channel letting everyone know that a character is about to be teleported to the hero using the power, and then activates the Teleport Target power. For the message to be more private, it could have done it this way:

/bind t "tell $target, Prepare to be teleported to my location.$$pow_exec_name Teleport Target"

In this example, the variable $target is actually part of the command. Remember, /tell needs a character name (followed by a comma) in order to know who to send the message to.

Using /Bind with Your Mouse

Mouse buttons are triggers just like standard keyboard keys are, so you can assign /bind commands to them in the same manner.

The trigger key names for each of the mouse buttons are listed below:

  • LBUTTON: The left mouse button on a right-handed mouse. It is usually referred to as "Mouse Button 1" when used in the context of both left and right handed mice.
  • RBUTTON: The right mouse button on a right-handed mouse. It is usually referred to as "Mouse Button 2" when used in the context of both left and right handed mice.
  • MBUTTON: The button between Mouse Button 1 and Mouse Button 2. In modern mice it usually doubles as the scroll wheel. It is often referred to as "Mouse Button 3."
  • BUTTON4
  • BUTTON5
  • BUTTON6
  • BUTTON7
  • BUTTON8

Buttons 4 through 8 are used to describe extra buttons your mouse may have. At present, it does not seem possible to successfully use button 6, button 7 or button 8 in key bindings, but button 4 and button 5 seem to work just fine depending on the mouse.

LBUTTON/BUTTON 1

Button 1 is used in-game when you select targets (friendly, unfriendly and neutral) and click on items in the user interface or certain objects in game. It seems to resist being overridden. You cannot, for example, attempt to replace its default "click" binding with another command. Attempts to do so cause both commands to execute.

For example:

/bind LBUTTON "+forward"

Does not replace button 1's default functionality with "forward." Instead, when you press down on button 1, a "click" is triggered and your character moves forward. This could have some awkward consequences. If your mouse was resting over a power icon in the power tray, for example, and you clicked on the button to move forward you would also click on that power.

RBUTTON/BUTTON 2

Button 2 is used in-game to "right click" on objects in order to see the options on their cascading menu. This is extremely important because it gives you access to the complete descriptions of powers and the ability to trade with other characters.

Button 2 is easier to override than button 1, but it still retains the ability to pop up a right-click menu no matter what you do to it.

MBUTTON/BUTTON 3

Button 3 is bound to +camrotate, which allows you to rotate the camera around your character.

Saving and Loading Key Bindings

If you want to save your custom keybinds to your hard drive, use the slash command /bind_save. This saves your custom keybinds in a file called keybinds.txt in your City of Heroes default folder. (C:\Games\Homecoming\Settings\Live by default).

/bind_save  
Saves the all current custom keybinds to keybinds.txt in the default folder.
/bind_load  
Loads custom keybinds from the file keybinds.txt in the default folder.

If you want to load the keybinds.txt file, use the slash command /bind_load. As long as the keybinds.txt file is still in your default folder, it will load automatically.

If you would like to save all of your currently active keybinds, including both custom and default keybinds, use /show_bind_all_file fileName.

It is possible to load other text files with bind commands into the game simply by specifying the file name and location. The full command is

/bind_load_file full path or relative path
Full path would be the full path to the file, including spaces (if there is a space, the path needs to be in quotes).
/bind_load_file C:\CoH\textfiles\judge.txt
The command would load the judge.txt file from the C:\CoH\textfiles directory.
Relative path would be any file or directory in the default folder.
/bind_load_file mybinds.txt
This would load the file c:\Games\Homecoming\Settings\Live\mybinds.txt.
/bind_load_file \binds\otherbinds.txt
This would load the file c:\Games\Homecoming\Settings\Live\binds\otherbinds.txt /bind_save_file follows the same rules.
/bind_save_file full path or relative path


When a bind file is loaded using either /bind_load or /bind_load_file, the new file does not replace the old file, it is merged with it. If a keybinding conflicts between the current file and the file being loaded, the binding in the file being loaded is used, but any key binding mentioned in the current file that is not present in the file being loaded is left alone.

Thus you can use /bind_load_file to load a keybinds file that has only two entries in it, and only those two entries will be changed. This is useful in the toggle key bindings section of the Neat Things You Can Do with /Bind section.

Understanding Keybinds.txt

The keybinds.txt file is the file that is created when you use the /bind_save slash command. It contains a list of all the custom triggers and commands you have defined for the character you saved it from.

This is a sample of what keybinds.txt looks like:

Q "powexec_name Hurricane"
R "powexec_name Sprint"
RALT "alttraysticky"
RBUTTON "+forward$$+mouse_look"
SHIFT+RBUTTON "+backward$$+mouse_look"
ALT+RBUTTON "nop"
RIGHT "+turnright"

Notice the /bind command is not used at all. All you see is the trigger and the command. If you want to make custom keybind files that can be loaded with the slash command /bind_load_file, you need to follow this format. Use the /bind command initially in the chat window, not in the keybinds.txt file.

Using "Rotating Text Binds"

/Bind is designed to tie a specific command to a specific key.  The command might be fairly elaborate, involving an action, speech, a remapping of auto-attack, and a few combinations of slash commands, but each time you press the key it always invokes the same command.  "One key, one command" is the way /bind was intended to work.

There is, however, a way around this.

Let's say that you want to bind some text to your character's taunt power, so that your character will actually taunt the villain when the power is activated. But you don't want to use the same text time after time after time, because you don't want your group to get annoyed. So you come up with five different taunts:

"Get over here!"
"You're next."
"Who wants some?"
"C'mere, ya pansy."
"Let's see what you've got."

These taunts will add a little variety to your character's taunting power, and because it is not the same thing over and over again, it may be a little tolerable for your teammates.

Now, you could go ahead and bind each taunt with your taunt power to a different key, but that would be wasteful. Wouldn't it be more convenient if you hit one taunt key, and each time you did so it called up a different taunt? It is possible to configure a key to rotate through a set of different key bindings, but it is a little complicated. The way you do this is by constantly replacing your current key binding with a new one using the command /bind_load_file

A Brief Tangent: A Recap of /Bind_load_file

The /bind_load slash command tells City of Heroes to load the keybinds.txt file in your City of Heroes application directory. The /bind_load_file slash command allows you to specify the name and location of the bindfile you want to load. Thus, if the following commands are used:

/bind_load_file C:\keybinds\curveball.txt
/bind_load_file C:\keybinds\stormhaven.txt
/bind_load_file C:\keybinds\judge.txt

The game would go into your c:\keybinds directory and load whatever file name specified.

The curveball.txt, stormhaven.txt and judge.txt files might have a few commands specific to those characters. For example, Stormhaven is a storm/electric defender, and the key used to bring up his hurricane power might be the same key used to bring up Curveball's teleport foe power. When a new character is created, /bind_load may be used to bring in my basic command set, and then /bind_load_file c:\keybinds\curveball.txt (or stormhaven.txt, or judge.txt) might be used to bring in character-specific key bindings.

And because these files only require a few deviations from the custom keybinds.txt file, only a few commands are needed in each:

curveball.txt

E "powexec_name Personal Force Field"
W "nop"
Q "powexec_name Teleport Foe"
F "nop"
T "nop"

stormhaven.txt

E "powexec_name Steamy Mist"
W "powexec_name Freezing Rain"
Q "powexec_name Hurricane"
F "powexec_name Hover"
T "nop"

judge.txt

E "powexec_name Temp Invulnerability"
W "nop"
Q "nop"
F "nop"
T "powexec_name Combat Jumping"

Each of these files only import five keybinds. Some of those keybinds are simply commands that overwrite what was originally there and replace it with nothing ([[slashcommand|nop}}) and others are specific powers.

If wanted, in the default keybinds.txt, Commands may be created that automatically loaded these:

NUMPAD1 "bind_load_file C:\keybinds\curveball.txt"
NUMPAD2 "bind_load_file C:\keybinds\stormhaven.txt"
NUMPAD3 "bind_load_file C:\keybinds\judge.txt"

By pressing the numbers 1, 2, and 3 on the number keypad, a custom bind set can be loaded.

Back on Course: Creating a Rotating Text Bind

To set up a key that rotates between the five taunts listed earlier in this section, you need to create custom keybind files for each of them. These keybind files need to contain three things:

  • the command to speak the taunt,
  • the command to activate the taunt command, and
  • the command to load the next taunt binding

The first thing you need to do is to create five keybind files: taunt1.txt, taunt2.txt, taunt3.txt, taunt4.txt, and taunt5.txt. In each taunt file, you need to put in the /bind command that gets executed. So each file would look like this:

taunt1.txt

T "local Get over here!$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt2.txt"

taunt2.txt

T "local You're next.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt3.txt"

taunt3.txt

T "local Who wants some?$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt4.txt"

taunt4.txt

T "local C'mere, ya pansy.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt5.txt"

taunt5.txt

T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"

When taunt1.txt is active, pressing T will cause the character to say "Get over here!" and activate the taunt power. At the same time, City of Heroes loads the taunt2.txt file and, since the bind command is for the same key, overwrites the T key with the new binding. So the next time T is pressed the character says "You're next." and the taunt power is launched again. This time, taunt3.txt is loaded, and that binding replaces the current one, and so forth and so on until finally taunt5.txt rebinds the key to load taunt1.txt, and the cycle starts over again.

Because the toggle bind is only loading and replacing one key binding at a time, the process takes place very quickly.

Now the only thing left to do is to actually bind T to the first toggle command. You can either do this manually or you can add it to your keybinds.txt file:

T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"

When you use the slash command /bind_load, then T will be bound to emulate the taunt5.txt binding, and the first taunt binding will activate the next time T is pressed.

As long as you are willing to be patient and set up your files before you get into the game, you can create rotating text binds for just about everything. For example, rotating text binds may be created for your mouse so that pressing a key loads one set of binds to the mouse to put it in "movement mode" and pressing it again loads another set of binds to put it in "default mode".

Macros

What do you do when you run out of keys to bind? Create icons.

By the time you've reached 40th level in City of Heroes, you will have roughly 20 powers. Some of those powers will be powers you need to activate, some won't. If every single power required activation, they would take up two full trays on your power bar.

So why are there nine trays? Why, so you can create your own icons, of course!

In City of Heroes it is possible to create your own buttons on the power bar. These icons can be activated with a mouse click, or can even be bound to keys if you use the /pow_exec_tray slash command to identify which tray and which slot in that tray the icon is sitting. You do this by using the /macro command.

/Macro is very similar to /bind.  You are, in effect, binding a command to an object.  The main difference is that /bind uses objects that already exist (keys on your keyboard) as the trigger, whereas /macro creates the trigger and then associates the command to it.  The trigger it creates is a new icon that sits on the first empty slot on your power bar.

The basic format for /macro is:

/macro macroName "command(s)"

It is possible to do anything with /macro that you can do with /bind. The only major difference is that instead of pressing a key to trigger the command, you click on the macro icon sitting in the power bar. You can also use any key bindings associated with the slot it is sitting in (for example, if it were in the second slot on the first tray of the power bar, you could press the 2 key to activate the macro) but you cannot bind a key directly to the macro itself.

People are often confused by /macro because it is so similar to /bind. Here is an example of macro creation to put the entire thing in context.

Let's say you want your character to have an emote/speech combination: You want him to perform the ThumbsUp emote and say "Good work!" But you don't want to devote a key to it — you need your keys for combat and navigation controls — but you decide it would be okay if you could just click on an icon in the power tray to perform that function.

The /bind command would be for this:

/bind [some key] "em ThumbsUp$$local Good Work!"

For /macro, [some key] is replaced by whatever name you want to give the macro:

/macro GW "em ThumbsUp$$local Good Work!"

Typing that in the command window will cause a new icon to appear in the first empty slot on the first available tray on your Power Bar with the letters "GW" stamped on it. You can now move that icon anywhere I want to on my tray, and clicking on it will cause your character to stick his thumb up in the air and say "Good Work!"

You can name your macro anything you like, but the icon has limited space to actually display the letters. You will probably want to try to keep your macros down to one- or two-letter names so they can be read clearly on the icon tray.

That is the /macro command in a nutshell. Really, that's all there is to it. /Macro seems tricky because it is almost identical /bind, and the "almost" throws people. The primary difference between the two is that /macro creates the object that triggers the command, and you need to tell the game what the object is named.

Saving Macros

Macros and their commands can be saved in a file, but there is no slash command to save the macros while in game. Instead you would need to type the macros into a text file manually, making sure that a double dollar sign ($$) is at the beginning of each macro command string. All the macros in the text file can then be automatically loaded into your character at once by using the /bind_load_file command. For example:

A sample text file holding macros might look like this:

myMacros.txt

$$macro Hi "emote wave"
$$macro Yes "emote thumbsup"
$$macro Dance "emote dance"

Then, to load the macros into your character, type:

/bind_load_file myMacros.txt

Rotating Text Macros

By using macros stored in text files in combination with the /bind_load_file and /Macroslot commands, complex rotating text macros can be created (very similar to rotating text binds). This allows one macro to replace another macro in the same power tray slot. Basically, it lets the same macro button do different things on each click.

As with rotating text binds, text files first need to be created with the various bind and macro commands in them. /bind_load_file is used to replace the bind commands, and the /macroslot command is used to replace one macro button with another button containing the commands from the next text file.

The syntax or format for text macros are exactly like normal binds except a double dollar sign ($$) must appear at the beginning of the command string. The following is an example of a rotating text macro:

mFlyCC0.txt

$$macroslot 20 "FlyON" "cc 1$$Powexec_Toggle_On Fly$$Bind_Load_File /binds/mFlyCC1.txt"

mFlyCC1.txt

$$macroslot 20 "FlyOFF" "cc 0$$Powexec_Toggle_Off Fly$$Bind_Load_File /binds/mFlyCC0.txt"

To enable the rotating text macro, type the commands inside the first text file into the chat box with a slash "/" at the beginning. Then press the Enter key to create the macro button for the first time.

/$$macroslot 20 "FlyON" "cc 1$$Powexec_Toggle_On Fly$$Bind_Load_File /binds/mFlyCC1.txt"

When the macro button is clicked, the character's outfit will change to costume #1 and the character will start flying. When the same macro button is clicked again, the character's outfit will change to a different costume (costume #0) and Fly will turn off. Then when the macro button is clicked again, the character will change to costume #1 and start to fly again, and so on.

Neat Things You Can Do with /Bind

This is the section that has samples of some of the fun stuff you can do with the /bind command.

Getting Around the "No Queued Attack" Rule

We have already learned that you cannot "queue up attacks" with /bind, but there are ways to get around that limitation to an extent. One of the participants in a "The Day I remapped my mouse with /bind" thread had an ingenious bind that did no less than SEVEN actions. The last two actions were to attack with two different ranged attacks. The second method was shared with me by the maker of Akai's proc calculator and doesn't execute multiple commands with one click, but instead executes a different attack on each click in a sort of loop.

Auto attack method

How did he do it? By not really attacking the first attack. Instead, he just set it up so that attacking would be the immediate consequence of the command:

/bind NUMPAD0 "pow_exec_auto Dark Blast$$pow_exec_name Moonbeam"

This is just the last bit of the original bind, which is much longer. When the 0 button on the number keypad is pressed, Dark Blast is set up as an automatically fired power. That is, it will fire at an enemy is selected and within range of the attack. After Dark Blast is set to auto, Moonbeam is fired. This is what happens:

  1. Dark Blast is set up as an "autofire" power.
  2. Moonbeam is fired.
  3. Dark Blast will fire, recharge, fire, recharge, fire, recharge, etc.

With this bind, two attacks were set up, but only one is specifically fired off.

Rotating Text Bind Method

When a bind is executed, it is parsed from left to right, but powers activate from RIGHT to LEFT in the bind string because multiple powers in a single bind string will interrupt each other as they attempt to activate, leaving the last power in the string (far right) to be the first one to activate unhindered. Taking advantage of this, the user can create a series of binds that each execute an attack first, then load the next bind in a series to the same key. This allows multiple attacks to be bound to the same key and queued in a cyclic order. Here's an example of how to do it:

Create a binds directory in the working directory of City of Heroes. In this example it's just called "binds". Create a .txt file with the bind you want, omitting the "bind" portion in the file. Will name this file "attack1.txt" NUMPAD0 "bind_load_file_silent /binds/attack2.txt$$pow_exec_name Moonbeam" Create a second .txt file with the next attack in the series, again omitting the "bind" portion, that is all done by the "bind_load_file_silent" command. This file will be called "attack2.txt" NUMPAD0 "bind_load_file_silent /binds/attack1.txt$$pow_exec_name Dark Blast" You can see how one file points to the other in a circular chain. Lastly, just set it up in-game by using either of the bind commands

/bind_load_file_silent /binds/attack1.txt Each time NUMPAD0 is pressed, it will first execute an attack, then rebind that key to execute the next attack. I saw a Mastermind (@Nexros global) use this method to bind a single key to combine any and all inspirations into reds, then automatically feed them to his pets--all with one key!

Splitting One Key Into Two Keys

The plus (+) and minus (-) symbols can be used as prefixes in front of a bind command string. Adding a prefix to the beginning of a bind command string tells the game to execute the command(s) on key press, and again on key release. For example, suppose we bind the following to the "K" key:

+$$sprint

When the K key is pressed down the power Sprint will turn on. As long as the key is pressed and held down, Sprint will continue to stay on. When the key is released, Sprint will toggle off because the Sprint command was executed again.

If used in combination with /bind_load_file and rotating text binds, this can effectively split one key into two, and allows us to bind 2 completely different bind command strings to a single key... one on key press, and the other on key release. For example:

KeyPress.txt

K "+$$Sprint$$bind_load_file KeyRelease.txt"

KeyRelease.txt

K "+$$Athletic Run$$bind_load_file KeyPress.txt"

This will activate Sprint when the K key is pressed, and then activate Athletic Run when the key is released.

Targeting the Nearest Enemy

The tab key is nice for quickly moving from enemy target to enemy target, but how do you quickly attack the closest enemy to you? It's easy. First you tell the game to target no one at all, then you tell it to target an enemy. It will always choose the closest one to you:

/bind space "target_enemy_near"

When you press the space bar, the game will drop any target you currently have and then target the closest enemy.

Remapping Your Mouse to Control Your Movement

If you are not satisfied using your keyboard to control all your movement, you can bind navigation and movement keys to your mouse buttons to give you greater mouse control. The following examples assume you have a four button mouse:

/bind RBUTTON "+forward$$+mouse_look"
/bind LBUTTON "-mouse_look"
/bind MBUTTON "map"
/bind BUTTON4 "+up"
/bind LSHIFT+RBUTTON "+backward$$+mouse_look"
/bind LALT+RBUTTON "-mouse_look"

The first button is the basic navigation command. When you click mouse button 2, the mouse enters "mouse look" mode. The mouse pointer disappears when you move the mouse to the left or right, your character turns left or right. When you move your mouse up or down, your character looks up or down (and if flying, your character tilts up or down). Now every time you press down on mouse button 2 your character will move forward.

The second binding ends mouse look. When you actually need to use your mouse to click on something, click on mouse button 1 and your pointer will reappear.

The third mouse binding causes the zone map to pop up whenever you press mouse button 3.

The fourth mouse binding allows mouse button 4 to control when the character jumps.

The fifth mouse binding acts just like the first, only instead of going forward the character moves backward.

The sixth mouse binding allows me to right-click on objects with my mouse when I have the left alt key pressed down in order to bring up the pop-up menu.

Selecting Teammates Using the Number Pad

This set of binds allows players to use the number pad to select their teammates and allies. For buffing or any other team selecting activity, this can be simpler than clicking with the mouse or using shift-<number>. Numbers 1-8 will select that particular team slot. The zero key contains a targeting bind to assist with buffing pets or players that are not on the team.

numberpad.txt

numpad1 teamselect 1
numpad2 teamselect 2
numpad3 teamselect 3
numpad4 teamselect 4
numpad5 teamselect 5
numpad6 teamselect 6
numpad7 teamselect 7
numpad8 teamselect 8
numpad0 target_custom_next friend notteammate notmypet

Note that the above text box is designed for a Bind File, such as c:\keybinds\numberpad.txt , which can then be loaded using the /bind_load_file command.

One could also bind them in separate commands using:

/bind numpad1 "teamselect 1"
/bind numpad2 "teamselect 2"
...

Players can then customize other number pad keys to use buffs. For instance, on characters that have Kinetics, one can use:

/bind add "powexec_name Increase Density"
/bind numpadenter "powexec_name Speed Boost"

This makes it easy to buff any single teammate or the whole team in succession.

The names of other keys on the number pad are: decimal, subtract, multiply, divide.

For a complete list of key names, see List of Key Names.


Source

The original text of this article was derived from The Incomplete and Unofficial Guide to /bind (1.1) by Curveball.