Dec 01, 2020, 06:25 am


SMF - Just Installed!

Advanced Keybinding - STO's scripting language

Started by Gervnd, Feb 23, 2013, 08:20 pm

Previous topic - Next topic


Feb 23, 2013, 08:20 pm Last Edit: Mar 05, 2013, 03:50 pm by Gervnd - Chip
By now, most everyone, if not actually everyone has learned the power of keybinds.  Personally, I can't imagine playing the game without them.

Some basic definitions:

Keybinding:  the act of attaching a power to a key such that when you press that key, the power is activated.

Advanced keybinding: the act of writing a script to bind one or more powers to a single key such that each action or power is activated one after another each time you press a key, sometimes once, sometimes more than once - depends.  Yes, it's another lesson.

A simple example would be to bind the 'Distribute Shield' power with the "Fire Phasers" power such that every time you fire your beam weapons, you also distribute the shields on your ship.  I'm sure many can see an advantage to that.  This is especially true because the rate at which a shield heals is proportional to its current level.  So, for example: let's say your front facing shield is red.  Because of this, it won't heal very quickly.  If the other three shields are a full power, distribute shields not only balances all the shields to the same strength drawing on the facings that aren't getting hit; but, it repairs more quickly the higher its level.  Plus, a 'shield heal' normally targets all shield facings. So, if one or more facings are at full power, buffing simply to raise the forward shield, or a forward and a side shield, the shields which are lower only get the buff.  The shields at full power get nothing.

So, by continually distributing the shields every time you fire the phasers, when your shields are yellow, all shields are yellow, and if they're all red... better buff soon.  So, when you do buff that shield, all facings are improved, and when one is down, you get a kind of automatic continuous buff by borrowing power from the other shields, and like I said, that's automatic, all you have to do is fire phasers.  This can be tied to fire torpedos, fire all, fire mines, or howerever you want to do it.

Another quick example would be if you use Photonic Officer,  by binding the officer to something you do all the time, he stays as activated as he can be.  If he is cooling down, and not active and can't be activated, naturally the command to activate is ignored; but, the moment he becomes available and you fire a weapon, he's automatically activated and all your Boffs get their cooldown times reduced.  And you have to do nothing, this is automatic.... IF, you use advanced keybinding.

Just to give you more examples, here is my distribute shields, distribute shields with fire phasers, and my evasive maneuvers contained in my Space keybinding script file.

|   E   Balance Shields + Photonic Officer
E "+STOTrayExecByTray 1 4 $$ +STOTrayExecByTray 0 0 $$ +STOTrayExecByTray 1 4 "

Note:  Sometimes I just need to distribute shields several times... but I throw in Photonic Officer II stored in tray 0 0 (1 1 to you) and distribute shields in tray 1 4 (2 5 to you).  In a later lesson I'll cover why the numbers are different, and why it's there two times.

|   D   Phasers with target Subsystem Shields & Balance Shields
D " +STOTrayExecByTray 2 0 $$ GenSendMessage HUD_Root FirePhasers $$ +STOTrayExecByTray 1 4 $$ GenSendMessage HUD_Root FirePhasers  $$ +STOTrayExecByTray 2 0"

Note: Subsystem Shields are in 2 0, and as before 1 4 is distribute shields and GenSendMessage... is another lesson.

|    Shift+E   Evasive Maneuvers
Shift+e "+STOTrayExecByTray 3 9 $$ FireMines $$ throttleadjust .99"

Note: Shift+E is evasive maneuvers  first I activate evasive manuevers Power Tray Slot 4 10, then make sure I'm moving, then Drop my mines (Chroniton - to slow him down if they're not in cooldown... and damage him (of course  ;) )

Another Note: you can add comments to this file, and the server ignores the comments when loading your binds.

Comment this topic, if you're interested in anything like this...  8)

To get started:  First, the STO wiki for advanced binding is partially out of date.  I've been working hard to fix this.  Here are two pages I maintain on the STO Wiki.  The first is stuff you may already know, and some extra.  The second is the Advanced Scripting... it's a work in progress that I've been working on for a couple of months now... so bear with me.

|Note:  Wiki pages to visit
| General Keybinding
| Advanced Scripting [That's what's on this page]

Note: I had a game bug in that I was unable to set a rally point for my Boffs, I have discovered this to be a game bug and have reported it.  It is due to a nonrelated scripting error to the command /ContextAction 1  ex: LeftShift "ContextAction 1".  Using /ContextAction 1 in any script will cause you to be unable to set a rally point for your Boffs, if you use rally points, take care not to use this command or that function of the game will fail!


I haven't even been able to create the logfile by which to begin to keybind.

Perhaps explaining things as if you were coaching a 6 year-old would be beneficial.