Recent Changes - Search

Main Menu (edit)

Random Average Blog

Wikis in Plain English

pmwiki.org

Recent Changes Printable View Page History Edit Page

/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 villian 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's not the same thing over and over again may be a little tolerable for your teammates.

Now, you could go ahead and bind each taunt with your taunt power, each to a different key, but that would be wasteful. Wouldnt' 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 "toggle" through a set of different keybindings, but it's a little complicated. The way you do this is by constantly replacing your current keybinding with a new one, using the command /bind_load_file

To set up a key that toggles between the five taunts I 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
  • 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!$$powexec_name Taunt$$bind_load_file c:\keybinds\taunt2.txt"

--taunt2.txt--

t "local You're next.$$powexec_name Taunt$$bind_load_file c:\keybinds\taunt3.txt"

--taunt3.txt--

t "local Who wants some?$$powexec_name Taunt$$bind_load_file c:\keybinds\taunt4.txt"

--taunt4.txt--

t "local C'mere, ya pansy.$$powexec_name Taunt$$bind_load_file c:\keybinds\taunt5.txt"

--taunt5.txt--

t "local Let's see what you've got.$$powexec_name Taunt$$bind_load_file c:\keybinds\taunt1.txt"

When taunt 1 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 -- and 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 keybinding 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.$$powexec_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 next time t is pressed the first taunt binding will activate.

As long as you are willing to be patient and set up your files before you get into the game, you can create toggle binds for just about everything. I was able to create a toggle bind for my mouse: pressing a key loaded one set of binds to my mouse (to put it in "movement mode") and pressing it again loaded another set of binds (to put it in "default mode").

Edit Page - Page History - Printable View - Recent Changes - Search
Page last modified on August 02, 2005, at 05:25 PM by DoyceTesterman

Creative Commons License
This work is licensed under a Creative Commons License.