Keybind Files

The Phoenix Division's science section for guides and resources.

Moderator: Fleet Leaders

User avatar
daBelgrave
Leader
Posts: 952
Joined: August 6th, 2012, 8:54 pm
Location: The Dabo Table
Contact:

Re: Keybind Files

Postby daBelgrave » April 26th, 2016, 8:11 pm

I Think It's Time To Get Complex
By now, you should be quite comfortable writing your own keybinds. Moving beyond those, we can create something called an alias. This is essentially the same as creating a custom chat command, like being able to type /Vulcan, and have the game automatically navigate your ship to Vulcan. Even better, you can then use the alias in your keybinds, such as v "vulcan".

Alias File Location
(you cannot change this)
Filename: CommandAliases.txt
Location: Star Trek Online\Live\Localdata\

Anatomy of an Alias
Every alias in CommandAliases.txt will share the same basic components.

Components: alias AliasName "Command"
Example: alias Vulcan "NavToPosition -9419 202 3480"

Every alias starts with alias, presumably to tell the game that it represents a command. AliasName is what you would type into your chat bar to activate the bind. In the example above, you would be able to type /Vulcan into your chat bar, and have it execute the alias. The "Command" is whatever the bind is expected to do. This part is always surrounded with quotation marks " " or it will not work. The "Command" can contain anything you could also put into a regular keybind, and probably a few other things too.

This Doesn't Seem Too Complex...
Yes, but we've only scratched the surface. Supposed we want to make an alias so we can chat in a channel other than the one we currently have active. For example, we might have our armada's custom channel active, but want to say something in Zone. This is possible by using {} in the alias, allowing us to pass it an additional parameter.

Example: alias z "zone {}"

Using this, we could type /z I hate zone chat to get our message across without switching away from another active channel.

Let's try that again, but for our custom Armada channel, Armada_One. The syntax requires custom channels to have quotation marks " " surrounding them, which poses a problem. If we surround the whole command with quotation marks, and also the channel name, how is the game supposed to know they are nested, and not two separate aliases? The answer to this problem is to replace the quotation marks surrounding the command with <& &>. This allows us to include quotation marks " " inside the command.

Example: alias A1 <&channelsend "Armada_One" {}&>

Using this, we could type /a1 Hello, armada! to send a message to everyone on this channel.

Let's take this a step further. Almost everyone remotely interested in PvP (and some PvE) makes a keybind to tell their team who to target. Did you know we could create an alias for that, which could pass our targeting command into any of the other channels for which we've created an alias? Try this:

alias z "zone {}"
alias t "team {}"
alias A1 <&channelsend "Armada_One" {}&>
alias tgt "{} Everyone target >>> $target <<<"

Using these aliases, we would type /tgt z to send the target info to Zone, /tgt t to send it to Team, or /tgt a1 to send it to Armada_One. Or, we can create additional aliases to send the message to practically any channel we desire. Whichever channel you send it to, everyone on that channel will see you say, "Everyone target >>> $target <<<"

Is That All?
Nah, sending the same targeting message every time is boring. Let's give it some variety.

alias z "zone {}"
alias t "team {}"
alias A1 <&channelsend "Armada_One" {}&>
alias TgtMsg0 <& {} Everyone target >>> $target <<< $$ alias TgtMsg0 "TgtMsg1" &>
alias TgtMsg1 <& {} It is a good day to kill $target $$ alias TgtMsg1 "TgtMsg2" &>
alias TgtMsg2 <& {} $target must die. $$ alias TgtMsg2 "TgtMsg3" &>
alias TgtMsg3 <& {} Shoot at $target immediately! $$ alias TgtMsg3 "TgtMsg4" &>
alias TgtMsg0 <& {} Everyone target >>> $target <<< $$ alias TgtMsg4 "TgtMsg1" &>
alias tgt "TgtMsg0 {}"

To use this we would type /tgt t (or substitute whatever other channel alias we want instead of t). Everyone on that channel would then see you say, "Everyone target >>> $target <<<". However, the next time you use that same command, everyone would see you say, "It is a good day to kill $target". Continuing to use the same command would keep cycling through all the TgtMsg aliases, keeping your friends entertained by the variety.

Technically, the alias cycle does not need to contain numbers, so long as each AliasName is unique.

OOPS!
Let me guess... You attempted to create your own cycling alias without completely understanding hit it works and crashed your game? There's no need for embarrassment; even I made that mistake when I first tried it. What you failed to notice was that the first alias in the cycle was never repeated; only the ones following it. Instead, you are supposed to have it cycle back to the second alias in the cycle, never the first. Let's look closely at this. You probably attempted something like:

alias AliasName0 <& <boring command> $$ alias AliasName0 "AliasName1" &>
alias AliasName1 <& <boring command> $$ alias AliasName1 "AliasName2" &>
alias AliasName2 <& <boring command> $$ alias AliasName2 "AliasName3" &>
alias AliasName3 <& <boring command> $$ alias AliasName3 "AliasName4" &>
alias AliasName4 <& <boring command> $$ alias AliasName4 "AliasName0" &>

You need to make it like:

alias AliasName0 <& <boring command> $$ alias AliasName0 "AliasName1" &>
alias AliasName1 <& <boring command> $$ alias AliasName1 "AliasName2" &>
alias AliasName2 <& <boring command> $$ alias AliasName2 "AliasName3" &>
alias AliasName3 <& <boring command> $$ alias AliasName3 "AliasName4" &>
alias AliasName4 <& <boring command> $$ alias AliasName4 "AliasName1" &>

The problem is this method essentially rewrites AliasName0 as whatever the next alias in the cycle actually is. However, if the last alias in the cycle tells it to rewrite as AliasName0, it tries rewriting itself as itself, something you cannot do. Of course, if you have an actual need to crash your game...

What Now?
Well, that's pretty much it. Aliases are very similar to keybinds, with only small differences and additions in the way you can use them. Now you can create aliases to expand your keybinding prowess. Get out there, write some keybinds and aliases, and conquer the quadrant!
Image
User avatar
daBelgrave
Leader
Posts: 952
Joined: August 6th, 2012, 8:54 pm
Location: The Dabo Table
Contact:

Re: Keybind Files

Postby daBelgrave » April 29th, 2016, 1:25 pm

I've now consolidated all my keybind and alias info into a single easy-to-read guide: http://bit.ly/STOKeybindGuide
Image

Who is online

Users browsing this forum: No registered users and 3 guests